Browse Source

更新库存导入功能

lwx_dev
erdanergou 3 years ago
parent
commit
d04edc1459
  1. 49
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java
  2. 18
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java
  3. 247
      src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java
  4. 118
      src/main/java/com/dreamchaser/depository_manage/controller/PageController.java
  5. 11
      src/main/java/com/dreamchaser/depository_manage/controller/PlaceController.java
  6. 2
      src/main/java/com/dreamchaser/depository_manage/entity/ExcelInfoByInventory.java
  7. 148
      src/main/java/com/dreamchaser/depository_manage/entity/Inventory.java
  8. 5
      src/main/java/com/dreamchaser/depository_manage/entity/MaterialAndBarCode.java
  9. 4
      src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryMapper.xml
  10. 2
      src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.java
  11. 8
      src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml
  12. 60
      src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.java
  13. 191
      src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml
  14. 5
      src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationModel.java
  15. 204
      src/main/java/com/dreamchaser/depository_manage/pojo/InventoryP.java
  16. 6
      src/main/java/com/dreamchaser/depository_manage/pojo/MaterialP.java
  17. 8
      src/main/java/com/dreamchaser/depository_manage/service/DepositoryService.java
  18. 36
      src/main/java/com/dreamchaser/depository_manage/service/MaterialService.java
  19. 11
      src/main/java/com/dreamchaser/depository_manage/service/PlaceService.java
  20. 123
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  21. 21
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryServiceImpl.java
  22. 62
      src/main/java/com/dreamchaser/depository_manage/service/impl/ExcelServiceImpl.java
  23. 358
      src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java
  24. 10
      src/main/java/com/dreamchaser/depository_manage/service/impl/PlaceServiceImpl.java
  25. 22
      src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java
  26. 16
      src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java
  27. 27
      src/main/java/com/dreamchaser/depository_manage/utils/DateUtil.java
  28. 6
      src/main/resources/application-test.yml
  29. 1
      src/main/resources/static/js/lay-config.js
  30. 18
      src/main/resources/templates/index_mobile.html
  31. 84
      src/main/resources/templates/pages/application/application-in.html
  32. 2
      src/main/resources/templates/pages/application/application-in_back.html
  33. 27
      src/main/resources/templates/pages/application/application-out.html
  34. 41
      src/main/resources/templates/pages/application/application-out_back.html
  35. 4
      src/main/resources/templates/pages/application/application-out_min.html
  36. 50
      src/main/resources/templates/pages/application/application-transfer.html
  37. 4
      src/main/resources/templates/pages/application/application_multi.html
  38. 2
      src/main/resources/templates/pages/chart/chart-out_back.html
  39. 3
      src/main/resources/templates/pages/chart/chart-stock_back.html
  40. 4
      src/main/resources/templates/pages/company/company-out.html
  41. 3
      src/main/resources/templates/pages/company/company-out_back.html
  42. 4
      src/main/resources/templates/pages/company/companyByParentId.html
  43. 4
      src/main/resources/templates/pages/depository/table-in.html
  44. 4
      src/main/resources/templates/pages/depository/table-out.html
  45. 79
      src/main/resources/templates/pages/depository/table-stock.html
  46. 4
      src/main/resources/templates/pages/material/material-out.html
  47. 4
      src/main/resources/templates/pages/material/material-out_back.html
  48. 127
      src/main/resources/templates/pages/material/selectPlaceByDepository.html
  49. 4
      src/main/resources/templates/pages/materialBarCode/materialBarCode_out.html
  50. 3
      src/main/resources/templates/pages/materialtype/materialTypeByParentId.html
  51. 6
      src/main/resources/templates/pages/materialtype/materialType_view.html
  52. 6
      src/main/resources/templates/pages/post/post-out.html
  53. 44
      src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html
  54. 2
      src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut_selectMaterial.html
  55. 4
      src/main/resources/templates/pages/stockTaking/stockTaking.html
  56. 4
      src/main/resources/templates/pages/user/table-user.html
  57. 4
      src/main/resources/templates/pages/warehouse/depository-out.html
  58. 2
      src/main/resources/templates/pages/warehouse/warehouseByParentId.html
  59. 22
      src/test/java/com/dreamchaser/depository_manage/TestForThisWeekInventory.java
  60. 8
      src/test/java/com/dreamchaser/depository_manage/TestForgetMapData.java
  61. 11
      src/test/java/com/dreamchaser/depository_manage/TestForgetShowData.java
  62. 16
      src/test/java/com/dreamchaser/depository_manage/TestForgetSourceList.java
  63. 4
      target/classes/META-INF/MANIFEST.MF
  64. 17
      target/classes/META-INF/spring-configuration-metadata.json
  65. 87
      target/classes/application-test.yml
  66. 5
      target/classes/application.yml
  67. 14
      target/classes/banner.txt
  68. 108
      target/classes/com/dreamchaser/depository_manage/mapper/AccesstoAddressMapper.xml
  69. 35
      target/classes/com/dreamchaser/depository_manage/mapper/CallBackLogMapper.xml
  70. 168
      target/classes/com/dreamchaser/depository_manage/mapper/CompanyMapper.xml
  71. 364
      target/classes/com/dreamchaser/depository_manage/mapper/DepositoryMapper.xml
  72. 1250
      target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml
  73. 908
      target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml
  74. 260
      target/classes/com/dreamchaser/depository_manage/mapper/MaterialTypeMapper.xml
  75. 131
      target/classes/com/dreamchaser/depository_manage/mapper/NoticeMapper.xml
  76. 316
      target/classes/com/dreamchaser/depository_manage/mapper/PlaceMapper.xml
  77. 143
      target/classes/com/dreamchaser/depository_manage/mapper/QrCodeMapper.xml
  78. 129
      target/classes/com/dreamchaser/depository_manage/mapper/RoleMapper.xml
  79. 329
      target/classes/com/dreamchaser/depository_manage/mapper/StockTakingMapper.xml
  80. 153
      target/classes/com/dreamchaser/depository_manage/mapper/TransferRecordMapper.xml
  81. 381
      target/classes/com/dreamchaser/depository_manage/mapper/UserMapper.xml
  82. 143
      target/classes/com/dreamchaser/depository_manage/mapper/standingBookMapper.xml
  83. 155
      target/classes/logback-spring.xml
  84. 26
      target/classes/redisson-config.yml
  85. 4
      target/classes/static/api/clear.json
  86. 226
      target/classes/static/api/init.json
  87. 220
      target/classes/static/api/init_checker.json
  88. 226
      target/classes/static/api/init_reviewer.json
  89. 100
      target/classes/static/api/init_user.json
  90. 254
      target/classes/static/api/menus.json
  91. 139
      target/classes/static/api/table-in.json
  92. 136
      target/classes/static/api/table-out.json
  93. 95
      target/classes/static/api/table-user.json
  94. 87
      target/classes/static/api/tableSelect.json
  95. 225
      target/classes/static/api/test.json
  96. 10
      target/classes/static/api/upload.json
  97. 934
      target/classes/static/css/layuimini.css
  98. 98
      target/classes/static/css/public.css
  99. 95
      target/classes/static/css/themes/default.css
  100. BIN
      target/classes/static/images/bg.jpg

49
src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java

@ -45,14 +45,14 @@ public class DepositoryController {
*/
public static Map<String, Object> getPreviousMonth() {
Calendar instance = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
Map<String, Object> source = new HashMap<>();
List<Object> sourceList = new ArrayList<>();
int month = instance.get(Calendar.MONTH) + 1;
ArrayList<Object> months = new ArrayList<>();
while (month > 0) {
instance.set(Calendar.MONTH, month);
instance.set(Calendar.DAY_OF_MONTH, 1);
instance.set(Calendar.DAY_OF_MONTH, -1);
source.put("month", month + "月");
months.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
month--;
@ -80,10 +80,10 @@ public class DepositoryController {
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK) - 1;
int offset1 = 1 - dayOfWeek;
calendar.add(Calendar.DATE, offset1 - 7);
lastTime.add(DateUtil.DateTimeByMonthToTimeStamp(sdf.format(calendar.getTime())));
lastTime.add(DateUtil.DateTimeByDayToTimeStamp(sdf.format(calendar.getTime())));
for (int i = 0; i < 7; i++) {
calendar.add(Calendar.DATE, 1);
lastTime.add(DateUtil.DateTimeByMonthToTimeStamp(sdf.format(calendar.getTime())));
lastTime.add(DateUtil.DateTimeByDayToTimeStamp(sdf.format(calendar.getTime())));
}
return lastTime;
}
@ -161,12 +161,12 @@ public class DepositoryController {
} else {
int now = instance.get(Calendar.DAY_OF_WEEK) - 1 == 0 ? 7 : instance.get(Calendar.DAY_OF_WEEK) - 1;
List<Long> days = new ArrayList<>();
days.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())));
Boolean flag = false;
while (now - 1 > 0) {
now--;
instance.add(Calendar.DATE, -1);
long format = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()));
long format = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()));
days.add(format);
}
while (it.hasNext()) {
@ -181,9 +181,9 @@ public class DepositoryController {
// 判断当天是否有出入口记录
Calendar IsInOut = Calendar.getInstance();
Long start = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(IsInOut.getTime()));
Long start = DateUtil.DateTimeByDayToTimeStamp(formatter.format(IsInOut.getTime()));
IsInOut.add(Calendar.DATE, 1);
Long end = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(IsInOut.getTime()));
Long end = DateUtil.DateTimeByDayToTimeStamp(formatter.format(IsInOut.getTime()));
// 判断今天是否有出入库记录
Integer inCount = depositoryRecordService.findApplicationInRecordByDate(end, start, null);
Integer OutCount = depositoryRecordService.findApplicationOutRecordByDate(end, start, null);
@ -287,8 +287,7 @@ public class DepositoryController {
for (int i = 0; i < depositoryAll.size(); i++) {
String dname = depositoryAll.get(i).getDname();
Integer todayDepositoryInventory = getInventoryByDname(dname,toDayInventoryByDNameTest);
result.add(todayDepositoryInventory);
((Map<String, Object>) sourceList.get(0)).put(dname, result.get(i));
((Map<String, Object>) sourceList.get(0)).put(dname, todayDepositoryInventory);
}
List<String> barSource = new ArrayList<>();
barSource.add("month");
@ -789,9 +788,9 @@ public class DepositoryController {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
if (weekDay == 1) {
//只获取今天
Long now = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()));
Long now = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()));
instance.add(Calendar.DATE, 1);
Long tomorrow = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()));
Long tomorrow = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()));
instance.add(Calendar.DATE, -2);
String yesterday = formatter.format(instance.getTime());
while (it.hasNext()) {
@ -812,13 +811,13 @@ public class DepositoryController {
int now = instance.get(Calendar.DAY_OF_WEEK) - 1 == 0 ? 7 : instance.get(Calendar.DAY_OF_WEEK) - 1;
List<Long> days = new ArrayList<>(); // 周一至今的每天
instance.add(Calendar.DATE, 1);
days.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())));
instance.add(Calendar.DATE, -1);
days.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())));
while (now - 1 > 0) {
now--;
instance.add(Calendar.DATE, -1);
Long format = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()));
Long format = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()));
days.add(format);
}
List<Integer> drCountbyDrName = new ArrayList<>();
@ -913,11 +912,11 @@ public class DepositoryController {
if (weekDay == 1) {
//只获取今天
Long now = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()));
Long now = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()));
instance.add(Calendar.DATE, 1);
Long tomorrow = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()));
Long tomorrow = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()));
instance.add(Calendar.DATE, -2);
Long yesterday = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()));
Long yesterday = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()));
while (it.hasNext()) {
// 遍历 Map并计算各仓库的入库数
Object key = it.next();
@ -1112,13 +1111,13 @@ public class DepositoryController {
int now = instance.get(Calendar.DAY_OF_WEEK) - 1 == 0 ? 7 : instance.get(Calendar.DAY_OF_WEEK) - 1;
List<Long> days = new ArrayList<>(); // 周一至今的每天
instance.add(Calendar.DATE, 1);
days.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())));
instance.add(Calendar.DATE, -1);
days.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())));
while (now - 1 > 0) {
now--;
instance.add(Calendar.DATE, -1);
Long format = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()));
Long format = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()));
days.add(format);
}
// 定义线程
@ -1579,6 +1578,14 @@ public class DepositoryController {
return new RestResponse(list);
}
// 构造库位树
@GetMapping("/treeMenus_Place")
public RestResponse InitTreeMenus_Place(@RequestParam(value = "depositoryId") Integer depositoryId){
List<Object> list = new ArrayList<>();
list = depositoryService.InitTreeMenus_Place(depositoryId);
return new RestResponse(list);
}
// 根据id获取仓库信息
@GetMapping("/findDepositoryByDid")
public RestResponse findDepositoryByDid(@RequestParam(value = "depositoryId") Integer depositoryId) {

18
src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java

@ -502,7 +502,7 @@ public class DepositoryRecordController {
// 设置展示时的数量为申请数-已出库数
simpleApplicationOutMinRecordP.setQuantity(applicationOutMinById.getQuantity() - applicationOutMinById.getTrueOut());
// 获取申请的物料信息
Material materialById = materialService.findMaterialById(applicationOutMinById.getMid());
Inventory materialById = materialService.findInventoryByMid(applicationOutMinById.getMid());
// 获取当前物料所存在的库位
List<PlaceP> placeByMidAndDid = placeService.findPlaceByMidAndDid(materialById.getId(), applicationOutMinById.getDepositoryId());
// 获取库位编码
@ -534,7 +534,7 @@ public class DepositoryRecordController {
for (MaterialAndProducedDate materialAndProducedDate :
materialAndProducedDateByMid) {
if (materialAndProducedDate.getInventory() >= simpleApplicationOutMinRecordP.getQuantity()) {
String producedDate = DateUtil.TimeStampToDateTimeForMonth(materialAndProducedDate.getProducedDate());
String producedDate = DateUtil.TimeStampToDateTimeForDay(materialAndProducedDate.getProducedDate());
simpleApplicationOutMinRecordP.setProducedDate(producedDate);
break;
}
@ -849,14 +849,15 @@ public class DepositoryRecordController {
// 获取库位编码
String placeCode =(String)(redisTemplate.opsForList().index("placeCodes"+userToken.getId(),i));
// 获取物料信息
Material materialById = materialService.findMaterialById(mid);
Inventory materialById = materialService.findInventoryByMid(mid);
// 获取仓库信息
Depository depositoryRecordById = depositoryService.findDepositoryRecordById(depositoryId);
ApplicationModel ap = new ApplicationModel();
ap.setDepositoryId(depositoryId);
ap.setDepositoryName(depositoryRecordById.getDname());
ap.setMid(mid);
ap.setMid(materialById.getMid());
ap.setIid(materialById.getId());
ap.setPlaceCode(placeCode);
ap.setVersion(materialById.getVersion());
ap.setMname(materialById.getMname());
@ -913,6 +914,7 @@ public class DepositoryRecordController {
departmentHeadId.append("78").append(",");
departMentHeadQyWxName.append("PangFuZhen").append(",");
map.put("departmenthead",departmentHeadId.toString());
map.put("mid",map.get("iid"));
Integer res = depositoryRecordService.insertApplicationOutRecord(map,userToken); // 插入主订单
if(res == 1){ // 如果插入成功
Object id = map.get("id"); // 获取主订单编号
@ -977,6 +979,7 @@ public class DepositoryRecordController {
String type = (String) map.get("type");
Integer success = 0;
List<Integer> mids = (List<Integer>) map.get("mids");
List<Integer> iids = (List<Integer>) map.get("iids");
List<Integer> depositoryIds = (List<Integer>) map.get("depositoryIds");
List<Object> quantitys = (List<Object>) map.get("quantitys");
List<String> placeCodes = (List<String>) map.get("placeCodes");
@ -1026,7 +1029,8 @@ public class DepositoryRecordController {
inRecord.put("applyRemark",applyRemark);
success += depositoryRecordService.applicationInPlace(inRecord);
}
}else if("out".equals(type)){
}
else if("out".equals(type)){
Map<String,Object> mainRecord = new HashMap<>();
Integer sumQuantity = 0;
for (int i = 0; i < quantitys.size(); i++) {
@ -1050,8 +1054,8 @@ public class DepositoryRecordController {
// 插入主表
depositoryRecordService.insertApplicationOutRecord(mainRecord,userToken);
id = ObjectFormatUtil.toInteger(mainRecord.get("id"));
for (int i = 0; i < mids.size(); i++) {
Integer mid = mids.get(i);
for (int i = 0; i < iids.size(); i++) {
Integer mid = iids.get(i);
Integer integer = ObjectFormatUtil.toInteger(quantitys.get(i));
// 获取当前仓库编号
Integer depositoryId = depositoryIds.get(i);

247
src/main/java/com/dreamchaser/depository_manage/controller/MaterialController.java

@ -7,21 +7,16 @@ import com.dreamchaser.depository_manage.config.JM_3DES;
import com.dreamchaser.depository_manage.entity.*;
import com.dreamchaser.depository_manage.exception.MyException;
import com.dreamchaser.depository_manage.pojo.*;
import com.dreamchaser.depository_manage.security.bean.UserToken;
import com.dreamchaser.depository_manage.service.*;
import com.dreamchaser.depository_manage.utils.CrudUtil;
import com.dreamchaser.depository_manage.utils.DateUtil;
import com.dreamchaser.depository_manage.utils.ObjectFormatUtil;
import com.sun.mail.imap.protocol.ID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -66,6 +61,7 @@ public class MaterialController {
/**
* 根据条件查询库存
*
* @param map 条件
* @param request 请求
* @return
@ -80,7 +76,7 @@ public class MaterialController {
// 定义仓库编号列表
List<Integer> didList = new ArrayList<>();
List<MaterialP> list = new ArrayList<>();
List<InventoryP> list = new ArrayList<>();
Integer total = 0;
Integer size = 10, page = 1; // 定义每页展示数量
if (map.containsKey("size")) {
@ -91,7 +87,7 @@ public class MaterialController {
Integer did = depositoryByAdminorg.get(i).getId();
didList.add(did);
map.put("depositoryId", did);
List<MaterialP> inventory = materialService.findInventory(map);
List<InventoryP> inventory = materialService.findInventory(map);
list.addAll(inventory);
total += materialService.findInventoryCount(map);
if (list.size() >= size) {
@ -120,14 +116,13 @@ public class MaterialController {
map.put("begin", (page - 1) * size - total);
}
map.put("size", size - list.size());
List<MaterialP> materialByDepository = materialService.findMaterialByDepository(map);
List<InventoryP> materialByDepository = materialService.findInventoryByDepository(map);
list.addAll(materialByDepository);
}
total += materialService.findMaterialByDepositoryCount(map);
}
}
else {
List<MaterialP> inventory = materialService.findInventory(map);
} else {
List<InventoryP> inventory = materialService.findInventory(map);
list.addAll(inventory);
total += materialService.findInventoryCount(map);
}
@ -221,9 +216,9 @@ public class MaterialController {
}
/**
* 根据id获取物料
*
* @param mid 物料id
* @return
*/
@ -242,13 +237,13 @@ public class MaterialController {
placePList.addAll(placeByMidAndDid);
}
Map<String, Object> param = new HashMap<>();
param.put("code", materialById.getCode());
List<MaterialP> inventory = materialService.findInventory(param);
param.put("mcode", materialById.getCode());
List<InventoryP> inventory = materialService.findInventory(param);
Map<String, Object> paramByBarcode = new HashMap<>();
paramByBarcode.put("mcode", materialById.getCode());
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(paramByBarcode);
if (inventory.size() > 0) {
MaterialP materialP = inventory.get(0);
InventoryP materialP = inventory.get(0);
materialP.setMaterialAndBarCodeList(materialByBarCodeByCondition);
map.put("materialById", materialP);
} else {
@ -297,14 +292,14 @@ public class MaterialController {
boolean flagForQuantity = true;
for (MaterialAndProducedDate materialAndProducedDate : materialAndProducedDateByMid) {
// 获取当前生产日期
producedDateList.add(DateUtil.TimeStampToDateTimeForMonth(materialAndProducedDate.getProducedDate()));
if(flagForQuantity) {
producedDateList.add(DateUtil.TimeStampToDateTimeForDay(materialAndProducedDate.getProducedDate()));
if (flagForQuantity) {
materialById.setQuantity(materialAndProducedDate.getInventory());
flagForQuantity = false;
}
}
map.put("materialById", materialById);
map.put("producedDateList",producedDateList);
map.put("producedDateList", producedDateList);
map.put("placeList", placePList);
return new RestResponse(map, 1, 200);
}
@ -328,33 +323,43 @@ public class MaterialController {
if ("".equals(code)) {
return new RestResponse(null, 1, 200);
}
param.put("code", code);
List<MaterialP> materialPByCondition = new ArrayList<>();
if ("out".equals(type)) {
// 如果是出库
List<InventoryP> inventoryPByCondition = new ArrayList<>();
param.put("mcode", code);
for (int i = 0; i < depositoryByAdminorg.size(); i++) {
param.put("depositoryId", depositoryByAdminorg.get(i).getId());
// 查找当前用户部门仓库中是否存在该物料
materialPByCondition = materialService.findInventory(param);
if (materialPByCondition.size() > 0) {
inventoryPByCondition = materialService.findInventory(param);
if (inventoryPByCondition.size() > 0) {
break;
}
}
} else { // 如果是入库
materialPByCondition = materialService.findMaterialPByCondition(param);
}
MaterialP mp = null;
if (materialPByCondition.size() > 0) {
mp = materialPByCondition.get(0);
InventoryP ip = null;
Map<String, Object> paramByPrice = new HashMap<>();
paramByPrice.put("code", mp.getCode());
if (inventoryPByCondition.size() > 0) {
ip = inventoryPByCondition.get(0);
paramByPrice.put("mcode", ip.getCode());
// 获取当前库存中的物料单价
List<MaterialP> inventory = materialService.findInventory(paramByPrice);
List<InventoryP> inventory = materialService.findInventory(paramByPrice);
if (inventory.size() > 0) {
mp.setPrice(inventory.get(0).getPrice());
ip.setPrice(inventory.get(0).getPrice());
} else {
mp.setPrice(0.0);
ip.setPrice(0.0);
}
paramByPrice.put("mcode", ip.getCode());
// 获取条形码与物料对应关系
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(paramByPrice);
ip.setMaterialAndBarCodeList(materialByBarCodeByCondition);
return new RestResponse(ip, 1, 200);
} else if("in".equals(type)) {
param.put("code", code);
materialPByCondition = materialService.findMaterialPByCondition(param);
if(materialPByCondition.size()>0) {
mp = materialPByCondition.get(0);
mp.setPrice(0.0);
mp.setMid(mp.getId());
paramByPrice.put("mcode", mp.getCode());
paramByPrice.remove("code");
// 获取条形码与物料对应关系
@ -363,6 +368,9 @@ public class MaterialController {
}
return new RestResponse(mp, 1, 200);
}
return new RestResponse(ip,1,200);
}
@PostMapping("/findMaterialByCondition")
public RestResponse findMaterialByCondition(@RequestBody Map<String, Object> map) {
@ -372,7 +380,7 @@ public class MaterialController {
@PostMapping("/findInventoryByCondition")
public RestResponse findInventoryByCondition(@RequestBody Map<String, Object> map) {
List<MaterialP> materialPByCondition = materialService.findInventory(map);
List<InventoryP> materialPByCondition = materialService.findInventory(map);
return new RestResponse(materialPByCondition, materialService.findInventoryCount(map), 200);
}
@ -462,7 +470,7 @@ public class MaterialController {
if (place != null) {
map.put("depositoryId", place.get("depositoryId"));
}
List<MaterialP> inventory = materialService.findInventory(map);
List<MaterialP> inventory = materialService.findMaterial(map);
if (inventory.size() > 0) {
MaterialP materialP = inventory.get(0);
Map<String, Object> params = new HashMap<>();
@ -498,10 +506,10 @@ public class MaterialController {
List<Depository> depositoryByAdminorg = depositoryService.findDepositoryByAdminorg(userByPort.getMaindeparment().toString());
for (int i = 0; i < depositoryByAdminorg.size(); i++) {
map.put("depositoryId", depositoryByAdminorg.get(i).getId());
List<MaterialP> inventory = materialService.findInventory(map);
List<InventoryP> inventory = materialService.findInventory(map);
if (inventory.size() > 0) { // 如果有库存
for (int j = 0; j < inventory.size(); j++) {
MaterialP materialP = inventory.get(j);
InventoryP materialP = inventory.get(j);
if (quantity <= materialP.getQuantity()) { // 如果当前数量合适则跳出循环
flag = true;
break;
@ -549,9 +557,9 @@ public class MaterialController {
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param);
for (int j = 0; j < depositoryByAdminorg.size(); j++) {
Depository depository = depositoryByAdminorg.get(j);
param.put("code", material.getString("code"));
param.put("mcode", material.getString("code"));
param.put("depositoryId", depository.getId());
List<MaterialP> inventory = materialService.findInventory(param);
List<InventoryP> inventory = materialService.findInventory(param);
if (inventory.size() > 0) {
List<PlaceP> place = placeService.findPlaceByMidAndDid(inventory.get(0).getId(), depository.getId());
placePList.addAll(place);
@ -580,27 +588,34 @@ public class MaterialController {
Map<String, Object> param = new HashMap<>();
List<PlaceP> placePList = new ArrayList<>();
param.put("mcode", mcode);
MaterialP mp = new MaterialP(material);
InventoryP ip = null;
// 获取物料与条形码的对应关系
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param);
for (int j = 0; j < depositoryByAdminorg.size(); j++) {
Depository depository = depositoryByAdminorg.get(j);
param.put("code", material.getCode());
param.put("mcode", material.getCode());
param.put("depositoryId", depository.getId());
// 获取当前仓库下是否有当前物料的库存
List<MaterialP> inventory = materialService.findInventory(param);
List<InventoryP> inventory = materialService.findInventory(param);
if (inventory.size() > 0) {
mp = inventory.get(0);
List<PlaceP> place = placeService.findPlaceByMidAndDid(mp.getId(), depository.getId());
ip = inventory.get(0);
List<PlaceP> place = placeService.findPlaceByMidAndDid(ip.getMid(), depository.getId());
placePList.addAll(place);
}
}
if(ip!=null){
// 设置当前物料在相关仓库下的所有库位
mp.setPlacePList(placePList);
ip.setPlacePList(placePList);
// 设置物料与条形码的对应关系
ip.setMaterialAndBarCodeList(materialByBarCodeByCondition);
return new RestResponse(ip);
}else{
MaterialP mp = new MaterialP(material);
// 设置物料与条形码的对应关系
mp.setMaterialAndBarCodeList(materialByBarCodeByCondition);
return new RestResponse(mp);
}
}
@ -620,16 +635,16 @@ public class MaterialController {
List<PlaceP> placePList = new ArrayList<>();
param.put("mcode", mcode);
MaterialP mp = null;
InventoryP mp = null;
// 获取物料与条形码的对应关系
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param);
Boolean flag = false;
for (int j = 0; j < depositoryByAdminorg.size(); j++) {
Depository depository = depositoryByAdminorg.get(j);
param.put("code", material.getCode());
param.put("mcode", material.getCode());
param.put("depositoryId", depository.getId());
// 获取当前仓库下是否有当前物料的库存
List<MaterialP> inventory = materialService.findInventory(param);
List<InventoryP> inventory = materialService.findInventory(param);
if (inventory.size() > 0) {
mp = inventory.get(0);
List<PlaceP> place = placeService.findPlaceByMidAndDid(mp.getId(), depository.getId());
@ -664,19 +679,19 @@ public class MaterialController {
List<PlaceP> placePList = new ArrayList<>();
param.put("mcode", mcode);
MaterialP mp = null;
InventoryP mp = null;
// 获取物料与条形码的对应关系
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param);
Boolean flag = false;
for (int j = 0; j < depositoryByAdminorg.size(); j++) {
Depository depository = depositoryByAdminorg.get(j);
param.put("code", material.getCode());
param.put("mcode", material.getCode());
param.put("depositoryId", depository.getId());
// 获取当前仓库下是否有当前物料的库存
List<MaterialP> inventory = materialService.findInventory(param);
List<InventoryP> inventory = materialService.findInventory(param);
if (inventory.size() > 0) {
mp = inventory.get(0);
List<PlaceP> place = placeService.findPlaceByMidAndDid(mp.getId(), depository.getId());
List<PlaceP> place = placeService.findPlaceByMidAndDid(mp.getMid(), depository.getId());
placePList.addAll(place);
flag = true;
}
@ -703,21 +718,21 @@ public class MaterialController {
// 获取扫描的物料
JSONArray materialListByJson = jsonObject.getJSONArray("materialList");
Map<String, Object> param = new HashMap<>();
List<MaterialP> materialPList = new ArrayList<>();
List<InventoryP> materialPList = new ArrayList<>();
String placeId = (String) map.get("placeId");
for (int i = 0; i < materialListByJson.size(); i++) {
Boolean flag = true;
JSONObject material = (JSONObject) materialListByJson.get(i);
param.put("mcode", material.getString("code"));
MaterialP mp = new MaterialP(materialService.findMaterialById(material.getInteger("mid")));
InventoryP mp = new InventoryP(materialService.findInventoryByMid(material.getInteger("mid")));
// 获取物料与条形码的对应关系
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param);
param.put("code", material.getString("code"));
param.put("mcode", material.getString("code"));
param.put("depositoryId", map.get("depositoryId"));
List<MaterialP> inventory = materialService.findInventory(param);
List<InventoryP> inventory = materialService.findInventory(param);
if (inventory.size() > 0) {
MaterialP materialP = inventory.get(0);
InventoryP materialP = inventory.get(0);
if (!"0".equals(placeId)) {
// 如果不是默认库位
MaterialAndPlace placeAndMaterialByMidAndPid = placeService.findPlaceAndMaterialByMidAndPid(ObjectFormatUtil.toInteger(placeId), materialP.getId());
@ -769,14 +784,15 @@ public class MaterialController {
// 用于标识是否成功获取
boolean flag = true;
param.put("mcode", material.getCode());
MaterialP mp = new MaterialP(material);
// MaterialP mp = new MaterialP(material);
InventoryP mp = new InventoryP();
// 获取物料与条形码的对应关系
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param);
param.put("code", material.getCode());
param.put("mcode", material.getCode());
param.put("depositoryId", map.get("depositoryId"));
List<MaterialP> inventory = materialService.findInventory(param);
List<InventoryP> inventory = materialService.findInventory(param);
if (inventory.size() > 0) {
MaterialP materialP = inventory.get(0);
InventoryP materialP = inventory.get(0);
if (!"0".equals(placeId)) {
// 如果不是默认库位
MaterialAndPlace placeAndMaterialByMidAndPid = placeService.findPlaceAndMaterialByMidAndPid(ObjectFormatUtil.toInteger(placeId), materialP.getId());
@ -807,7 +823,7 @@ public class MaterialController {
List<String> producedDateList = new ArrayList<>();
for (MaterialAndProducedDate materialAndProducedDate : materialAndProducedDateByMid) {
// 获取当前生产日期
producedDateList.add(DateUtil.TimeStampToDateTimeForMonth(materialAndProducedDate.getProducedDate()));
producedDateList.add(DateUtil.TimeStampToDateTimeForDay(materialAndProducedDate.getProducedDate()));
}
mp.setProducedDateList(producedDateList);
return new RestResponse(mp);
@ -890,6 +906,7 @@ public class MaterialController {
materialByBarCode = materialService.findMaterialByBarCode(qrCode);
}
result.put("material", materialByBarCode);
return new RestResponse(result);
}
@ -919,11 +936,11 @@ public class MaterialController {
for (int j = 0; j < depositoryByAdminorg.size(); j++) {
Map<String, Object> param = new HashMap<>();
param.put("depositoryId", depositoryByAdminorg.get(j).getId());
param.put("code", materialByBarCode.getMcode());
List<MaterialP> inventory = materialService.findInventory(param);
param.put("mcode", materialByBarCode.getMcode());
List<InventoryP> inventory = materialService.findInventory(param);
if (inventory.size() > 0) {
// 如果存在该物料
MaterialP materialP = inventory.get(0);
InventoryP materialP = inventory.get(0);
materialByBarCode.setMid(materialP.getId());
List<PlaceP> placeByMidAndDid = placeService.findPlaceByMidAndDid(materialP.getId(), depositoryByAdminorg.get(j).getId());
placePList.addAll(placeByMidAndDid);
@ -961,11 +978,11 @@ public class MaterialController {
Boolean isExist = false;
Map<String, Object> param = new HashMap<>();
param.put("depositoryId", depositoryByAdminorg.get(j).getId());
param.put("code", materialByBarCode.getMcode());
List<MaterialP> inventory = materialService.findInventory(param);
param.put("mcode", materialByBarCode.getMcode());
List<InventoryP> inventory = materialService.findInventory(param);
if (inventory.size() > 0) {
// 如果存在该物料
MaterialP materialP = inventory.get(0);
InventoryP materialP = inventory.get(0);
materialByBarCode.setMid(materialP.getId());
List<PlaceP> placeByMidAndDid = placeService.findPlaceByMidAndDid(materialP.getId(), depositoryByAdminorg.get(j).getId());
placePList.addAll(placeByMidAndDid);
@ -996,11 +1013,11 @@ public class MaterialController {
Boolean isExist = false;
Map<String, Object> param = new HashMap<>();
param.put("depositoryId", depositoryByAdminorg.get(j).getId());
param.put("code", materialByBarCode.getMcode());
List<MaterialP> inventory = materialService.findInventory(param);
param.put("mcode", materialByBarCode.getMcode());
List<InventoryP> inventory = materialService.findInventory(param);
if (inventory.size() > 0) {
// 如果存在该物料
MaterialP materialP = inventory.get(0);
InventoryP materialP = inventory.get(0);
List<PlaceP> placeByMidAndDid = placeService.findPlaceByMidAndDid(materialP.getId(), depositoryByAdminorg.get(j).getId());
materialByBarCode.setMid(materialP.getId());
placePList.addAll(placeByMidAndDid);
@ -1029,7 +1046,7 @@ public class MaterialController {
// 获取标志位,用于判断是否扫描二维码
Boolean flag = jsonObject.getBoolean("flag");
Map<String, Object> result = new HashMap<>();
List<MaterialP> materialList = new ArrayList<>();
List<InventoryP> materialList = new ArrayList<>();
String placeId = (String) map.get("placeId");
// 用于存储没有对应关系的条形码
List<String> barCodeListByNoMaterial = new ArrayList<>();
@ -1043,12 +1060,12 @@ public class MaterialController {
Boolean isExist = false;
Map<String, Object> param = new HashMap<>();
param.put("depositoryId", map.get("depositoryId"));
param.put("code", materialByBarCode.getMcode());
List<MaterialP> inventory = materialService.findInventory(param);
MaterialP mp = new MaterialP();
param.put("mcode", materialByBarCode.getMcode());
List<InventoryP> inventory = materialService.findInventory(param);
InventoryP mp = new InventoryP();
if (inventory.size() > 0) {
// 如果存在该物料
MaterialP materialP = inventory.get(0);
InventoryP materialP = inventory.get(0);
Map<String, Object> paramByBarCode = new HashMap<>();
paramByBarCode.put("mcode", materialP.getCode());
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(paramByBarCode);
@ -1095,14 +1112,14 @@ public class MaterialController {
Boolean tempflag = true;
JSONObject material = (JSONObject) materialListByJson.get(i);
param.put("mcode", material.getString("code"));
MaterialP mp = new MaterialP(materialService.findMaterialById(material.getInteger("mid")));
InventoryP mp = new InventoryP(materialService.findInventoryByMid(material.getInteger("mid")));
// 获取物料与条形码的对应关系
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param);
param.put("code", material.getString("code"));
param.put("mcode", material.getString("code"));
param.put("depositoryId", map.get("depositoryId"));
List<MaterialP> inventory = materialService.findInventory(param);
List<InventoryP> inventory = materialService.findInventory(param);
if (inventory.size() > 0) {
MaterialP materialP = inventory.get(0);
InventoryP materialP = inventory.get(0);
if (!"0".equals(placeId)) {
// 如果不是默认库位
MaterialAndPlace placeAndMaterialByMidAndPid = placeService.findPlaceAndMaterialByMidAndPid(ObjectFormatUtil.toInteger(placeId), materialP.getId());
@ -1142,7 +1159,7 @@ public class MaterialController {
// 获取具体的条形码
String barCode = (String) map.get("qrCode");
Map<String, Object> result = new HashMap<>();
MaterialP material = null;
InventoryP material = null;
Object pid = map.get("placeId");
String placeId = "0";
if (pid != null) {
@ -1159,12 +1176,12 @@ public class MaterialController {
Map<String, Object> param = new HashMap<>();
// 判断所在仓库
param.put("depositoryId", map.get("depositoryId"));
param.put("code", materialByBarCode.getMcode());
List<MaterialP> inventory = materialService.findInventory(param);
MaterialP mp = new MaterialP();
param.put("mcode", materialByBarCode.getMcode());
List<InventoryP> inventory = materialService.findInventory(param);
InventoryP mp = new InventoryP();
if (inventory.size() > 0) {
// 如果存在该物料
MaterialP materialP = inventory.get(0);
InventoryP materialP = inventory.get(0);
// 设置标志位true
isExist = true;
if (!"0".equals(placeId)) {
@ -1196,14 +1213,14 @@ public class MaterialController {
// 如果当前条形码不存对应物料
barCodeListByNoMaterial.add(barCode);
}
if(material != null){
if (material != null) {
// 获取当前物料对应的生产日期
List<MaterialAndProducedDate> materialAndProducedDateByMid = materialService.findMaterialAndProducedDateByMid(material.getId());
List<String> producedDateList = new ArrayList<>();
// 用于标志是否要更改数量
for (MaterialAndProducedDate materialAndProducedDate : materialAndProducedDateByMid) {
// 获取当前生产日期
producedDateList.add(DateUtil.TimeStampToDateTimeForMonth(materialAndProducedDate.getProducedDate()));
producedDateList.add(DateUtil.TimeStampToDateTimeForDay(materialAndProducedDate.getProducedDate()));
material.setQuantity(materialAndProducedDate.getInventory());
}
material.setProducedDateList(producedDateList);
@ -1272,7 +1289,7 @@ public class MaterialController {
Map<String, Object> param = new HashMap<>();
param.put("mname", map.get("mname"));
param.put("depositoryId", map.get("depositoryId"));
List<MaterialP> inventory = materialService.findInventory(param);
List<InventoryP> inventory = materialService.findInventory(param);
if ("0".equals(placeId)) {
// 如果是默认库位
return new RestResponse(inventory, materialService.findInventoryCount(param), 200);
@ -1286,7 +1303,7 @@ public class MaterialController {
return new RestResponse(inventory);
} else {
// 获取当前物料
MaterialP materialP = inventory.get(0);
InventoryP materialP = inventory.get(0);
MaterialAndPlace pm = placeService.findPlaceAndMaterialByMidAndPid(ObjectFormatUtil.toInteger(placeById), materialP.getId());
if (pm != null) {
// 如果成功获取
@ -1326,10 +1343,10 @@ public class MaterialController {
}
param.put("mcode", code);
List<MaterialAndBarCode> materialByBarCodeByCondition = materialService.findMaterialByBarCodeByCondition(param);
List<MaterialP> materialPByCondition = new ArrayList<>();
MaterialP mp = null;
List<InventoryP> materialPByCondition = new ArrayList<>();
InventoryP mp = null;
param.put("code", code);
param.put("mcode", code);
param.put("depositoryId", depositoryId);
materialPByCondition = materialService.findInventory(param);
@ -1361,7 +1378,7 @@ public class MaterialController {
}
}
if(mp != null){
if (mp != null) {
// 获取当前物料对应的生产日期
List<MaterialAndProducedDate> materialAndProducedDateByMid = materialService.findMaterialAndProducedDateByMid(mp.getId());
List<String> producedDateList = new ArrayList<>();
@ -1369,8 +1386,8 @@ public class MaterialController {
boolean flagForQuantity = true;
for (MaterialAndProducedDate materialAndProducedDate : materialAndProducedDateByMid) {
// 获取当前生产日期
producedDateList.add(DateUtil.TimeStampToDateTimeForMonth(materialAndProducedDate.getProducedDate()));
if(flagForQuantity) {
producedDateList.add(DateUtil.TimeStampToDateTimeForDay(materialAndProducedDate.getProducedDate()));
if (flagForQuantity) {
mp.setQuantity(materialAndProducedDate.getInventory());
flagForQuantity = false;
}
@ -1383,17 +1400,18 @@ public class MaterialController {
/**
* 用于根据当前物料与其生产日期获取对应库存容量
*
* @param map
* @param request
* @return
*/
@PostMapping("/findQuantityByProducedDate")
public RestResponse findQuantityByProducedDate(@RequestBody Map<String,Object> map,HttpServletRequest request){
public RestResponse findQuantityByProducedDate(@RequestBody Map<String, Object> map, HttpServletRequest request) {
Integer mid = ObjectFormatUtil.toInteger(map.get("mid"));
String producedDate = (String) map.get("producedDate");
map.put("producedDate",DateUtil.DateTimeByMonthToTimeStamp(producedDate));
map.put("producedDate", DateUtil.DateTimeByDayToTimeStamp(producedDate));
MaterialAndProducedDate materialAndProducedDateByMidAndProducedDate = materialService.findMaterialAndProducedDateByMidAndProducedDate(map);
if(materialAndProducedDateByMidAndProducedDate != null){
if (materialAndProducedDateByMidAndProducedDate != null) {
return new RestResponse(materialAndProducedDateByMidAndProducedDate.getInventory());
}
return new RestResponse(0);
@ -1446,7 +1464,7 @@ public class MaterialController {
List<String> mcodeList = new ArrayList<>();
for (int i = 0; i < placeAndMaterialByPid.size(); i++) {
MaterialAndPlace materialAndPlace = placeAndMaterialByPid.get(i);
Material materialById = materialService.findMaterialById(materialAndPlace.getMid());
Inventory materialById = materialService.findInventoryByMid(materialAndPlace.getMid());
mcodeList.add(materialById.getCode());
}
pp.setMcodeList(mcodeList);
@ -1481,9 +1499,9 @@ public class MaterialController {
Object mtId = map.get("mtId");
List<Object> list = new ArrayList<>();
if (mtId != null) {
if("2".equals(type)){
map.put("adminorg",String.valueOf(maindeparment));
}else if("3".equals(type)){
if ("2".equals(type)) {
map.put("adminorg", String.valueOf(maindeparment));
} else if ("3".equals(type)) {
String depositoryId = (String) map.get("depositoryId");
String placeId = (String) map.get("placeId");
map.put("depositoryId", depositoryId);
@ -1499,16 +1517,35 @@ public class MaterialController {
/**
* 用于关闭当前打开的树
*
* @param map
* @param request
*/
@PostMapping("/closeTreeChildren")
public void closeTreeChildren(@RequestBody Map<String,Object> map,HttpServletRequest request){
if(map.containsKey("mtId")){
public void closeTreeChildren(@RequestBody Map<String, Object> map, HttpServletRequest request) {
if (map.containsKey("mtId")) {
Long mtId = Long.valueOf(map.get("mtId").toString());
materialService.closeTreeChildren(mtId);
}else{
} else {
throw new MyException("缺少必要参数");
}
}
/**
* 用于修改当前物料所在库位
* @param map
* @param request
* @return
*/
@PostMapping("/editPlaceMaterial")
public RestResponse editPlaceMaterial(@RequestBody Map<String,Object> map,HttpServletRequest request){
Integer integer = materialService.editPlaceMaterial(map);
if(Integer.compare(-1,integer) == 0){
return new RestResponse("",-1,new StatusInfo("转移失败","转入位置无法存放当前数量的库存"));
}else{
return CrudUtil.putHandle(1,integer);
}
}
}

118
src/main/java/com/dreamchaser/depository_manage/controller/PageController.java

@ -279,7 +279,7 @@ public class PageController {
public ModelAndView welcome(HttpServletRequest request) {
ModelAndView mv = new ModelAndView();
String header = request.getHeader("user-agent");
UserByPort userToken= (UserByPort) request.getAttribute("userToken");
UserByPort userToken = (UserByPort) request.getAttribute("userToken");
boolean b = DeviceUtil.checkAgentIsMobile(header);
if (b) {
mv.setViewName("pages/other/welcome_mobile");
@ -319,9 +319,9 @@ public class PageController {
mv.addObject("notices", noticeService.findNoticeByCondition(map));
Map<String,Object> paramForTask = new HashMap<>();
paramForTask.put("isDone",0);
paramForTask.put("userId",userToken.getId());
Map<String, Object> paramForTask = new HashMap<>();
paramForTask.put("isDone", 0);
paramForTask.put("userId", userToken.getId());
// 定义任务列表
List<SimpleTaskP> list = new ArrayList<>();
@ -340,22 +340,22 @@ public class PageController {
list.add(simpleTaskP);
}
String key = "user:"+userToken.getId().toString();
String key = "user:" + userToken.getId().toString();
String minRecord = (String) redisTemplateForHash.opsForHash().get(key, "minRecord");
if(minRecord != null){
if (minRecord != null) {
// 获取子订单键值
String[] split = minRecord.replace("[","").replace("]","").split(",");
String[] split = minRecord.replace("[", "").replace("]", "").split(",");
for (int i = 0; i < split.length; i++) {
Integer minRecordId = ObjectFormatUtil.toInteger(split[i].split(":")[1]);
ApplicationOutRecordMin applicationOutMinById = depositoryRecordService.findApplicationOutMinById(minRecordId);
ApplicationOutRecordP applicationOutRecordPById = depositoryRecordService.findApplicationOutRecordPById(applicationOutMinById.getParentId());
UserByPort userByPort = LinkInterfaceUtil.FindUserById(applicationOutRecordPById.getApplicantId(), userToken);
applicationOutRecordPById.setApplicantName(userByPort.getName());
SimpleTaskP simpleTaskP = new SimpleTaskP(applicationOutRecordPById,applicationOutMinById);
SimpleTaskP simpleTaskP = new SimpleTaskP(applicationOutRecordPById, applicationOutMinById);
list.add(simpleTaskP);
}
}
mv.addObject("myTaskList",list);
mv.addObject("myTaskList", list);
return mv;
}
@ -400,7 +400,7 @@ public class PageController {
Integer isadmin = userToken.getIsadmin();
// 获取当天时间戳
String currentDate = DateUtil.getCurrentDate();
Long aLong = DateUtil.DateTimeByMonthToTimeStamp(currentDate);
Long aLong = DateUtil.DateTimeByDayToTimeStamp(currentDate);
mv.addObject("nowDay", aLong);
if (isadmin == null) {
isadmin = 1;
@ -440,6 +440,38 @@ public class PageController {
return mv;
}
@GetMapping("/selectPlaceByDepository")
// 库位树形菜单
public ModelAndView selectPlaceByDepository(Integer depositoryId, Integer mid, String placeCode) {
ModelAndView mv = new ModelAndView();
MaterialAndPlace placeAndMaterialByMidAndPid = null;
if ("0000".equals(placeCode)) {
// 如果要改变默认库位
// 获取当前物料的对应关系
placeAndMaterialByMidAndPid = placeService.findPlaceAndMaterialByMidAndPid(0, mid);
mv.addObject("placeId", 0);
} else {
// 获取当前库位id
Map<String, Object> map = new HashMap<>();
map.put("code", placeCode);
map.put("depositoryId", depositoryId);
List<Place> placeByCondition = placeService.findPlaceByCondition(map);
//获取对应库位
Place place = placeByCondition.get(0);
// 获取当前物料的对应关系
placeAndMaterialByMidAndPid = placeService.findPlaceAndMaterialByMidAndPid(place.getId(), mid);
mv.addObject("placeId", place.getId());
}
mv.addObject("depositoryId", depositoryId);
mv.addObject("quantity",placeAndMaterialByMidAndPid.getQuantity());
mv.addObject("mid",mid);
mv.setViewName("pages/material/selectPlaceByDepository");
return mv;
}
// 专用于卡片仓库树形菜单页面
@GetMapping("/selectDepositoryByCard")
@ -564,16 +596,16 @@ public class PageController {
@GetMapping("/application_in_back")
public ModelAndView applicationIn(Integer mid, Integer depositoryId) {
ModelAndView mv = new ModelAndView();
Material materialById = new Material();
Inventory materialById = new Inventory();
Depository depositoryRecordById = new Depository();
if (mid != null) {
materialById = materialService.findMaterialById(mid);
materialById = materialService.findInventoryByMid(mid);
}
if (depositoryId != null) {
depositoryRecordById = depositoryService.findDepositoryRecordById(depositoryId);
}
if(materialById.getShelfLife() == null){
mv.addObject("display","none");
if (materialById.getShelfLife() == null) {
mv.addObject("display", "none");
}
mv.addObject("materialById", materialById);
mv.addObject("depository", depositoryRecordById);
@ -596,16 +628,16 @@ public class PageController {
}
@GetMapping("/application_out_back")
public ModelAndView application_out_back(Integer code, String depositoryId) {
public ModelAndView application_out_back(String code, String depositoryId) {
ModelAndView mv = new ModelAndView();
mv.setViewName("pages/application/application-out_back");
MaterialP materialById = new MaterialP();
InventoryP materialById = new InventoryP();
if (code != null) {
Map<String, Object> map = new HashMap<>();
Depository depositoryByCode = depositoryService.findDepositoryRecordById(ObjectFormatUtil.toInteger(depositoryId));
map.put("depositoryId", depositoryByCode.getId());
map.put("code", code);
List<MaterialP> inventory = materialService.findInventory(map);
map.put("mcode", code);
List<InventoryP> inventory = materialService.findInventory(map);
if (inventory.size() < 1) {
mv.addObject("materialById", new Material());
} else {
@ -732,22 +764,22 @@ public class PageController {
// 转出物料数量
mv.addObject("OutCount", mapForOut.get("count"));
// 获取数量比值
mv.addObject("outCountRadio",mapForOut.get("radioForCount"));
mv.addObject("outCountRadio", mapForOut.get("radioForCount"));
// 出库物料总额
mv.addObject("OutPrice", mapForOut.get("price"));
// 获取金额比值
mv.addObject("outPriceRadio",mapForOut.get("radioForPrice"));
mv.addObject("outPriceRadio", mapForOut.get("radioForPrice"));
// 获取要出库的记录数据
Map<String, Object> mapForTrueOut = depositoryRecordService.CalculateAllApplicationOutCount("");
// 转出物料金额
mv.addObject("allOutCount", mapForTrueOut.get("count"));
// 获取数量比值
mv.addObject("outAllCountRadio",mapForTrueOut.get("radioForCount"));
mv.addObject("outAllCountRadio", mapForTrueOut.get("radioForCount"));
// 出售物料数量
mv.addObject("allOutPrice", mapForTrueOut.get("price"));
// 获取金额比值
mv.addObject("outAllPriceRadio",mapForTrueOut.get("radioForPrice"));
mv.addObject("outAllPriceRadio", mapForTrueOut.get("radioForPrice"));
return mv;
}
@ -1050,7 +1082,7 @@ public class PageController {
// 获取子订单信息
ApplicationOutRecordMin applicationOutRecordMin = applicationOutRecordMinByParent.get(i);
// 获取出库物料信息
Material materialById = materialService.findMaterialById(applicationOutRecordMin.getMid());
Inventory materialById = materialService.findInventoryByMid(applicationOutRecordMin.getMid());
// 获取出库物料仓库信息
Depository depository = depositoryService.findDepositoryRecordById(applicationOutRecordMin.getDepositoryId());
// 获取出库库位
@ -1136,7 +1168,7 @@ public class PageController {
ApplicationOutRecordMin recordMin = depositoryRecordService.findApplicationOutMinById(id);
ApplicationOutRecordMinP recordMinP = new ApplicationOutRecordMinP(recordMin);
// 获取出库物料信息
Material materialById = materialService.findMaterialById(recordMin.getMid());
Inventory materialById = materialService.findInventoryByMid(recordMin.getMid());
// 获取出库物料仓库信息
Depository depository = depositoryService.findDepositoryRecordById(recordMin.getDepositoryId());
// 获取出库库位
@ -1197,7 +1229,7 @@ public class PageController {
ApplicationOutRecordMinP recordMinP = new ApplicationOutRecordMinP(applicationOutRecordMin);
// 获取出库物料信息
Material materialById = materialService.findMaterialById(applicationOutRecordMin.getMid());
Inventory materialById = materialService.findInventoryByMid(applicationOutRecordMin.getMid());
// 获取出库物料仓库信息
Depository depository = depositoryService.findDepositoryRecordById(applicationOutRecordMin.getDepositoryId());
// 获取出库库位
@ -1707,7 +1739,7 @@ public class PageController {
// 获取当前要处理的子订单
ApplicationOutRecordMin applicationOutMinById = depositoryRecordService.findApplicationOutMinById(id);
mv.setViewName("pages/scanQrCode/ScanBarOrQrCodeOut");
Material materialById = materialService.findMaterialById(applicationOutMinById.getMid());
Inventory materialById = materialService.findInventoryByMid(applicationOutMinById.getMid());
mv.addObject("materialById", materialById);
mv.addObject("record", applicationOutMinById);
return mv;
@ -1715,19 +1747,41 @@ public class PageController {
// 用于展示当前库位所存在的物料
@GetMapping("/ScanBarOrQrCodeOut_selectMaterial")
public ModelAndView ScanBarOrQrCodeOut_selectMaterial(Integer pid,String mcode){
public ModelAndView ScanBarOrQrCodeOut_selectMaterial(Integer pid, String mcode, Integer depositoryId) {
ModelAndView mv = new ModelAndView();
// 获取当前库位中
List<MaterialAndPlace> placeAndMaterialByPid = placeService.findPlaceAndMaterialByPid(pid);
// 用于存储物料id
List<Integer> midList = new ArrayList<>();
if (Integer.compare(0, pid) == 0) {
// 如果是默认库位
Map<String, Object> map = new HashMap<>();
map.put("depositoryId", depositoryId);
// 获取当前仓库下的所有库存
List<InventoryP> inventoryByDepository = materialService.findInventoryByDepository(map);
for (int i = 0; i < inventoryByDepository.size(); i++) {
// 如果该库存明细在默认库位中
MaterialAndPlace placeAndMaterialByMidAndPid = placeService.findPlaceAndMaterialByMidAndPid(0, inventoryByDepository.get(i).getId());
if (placeAndMaterialByMidAndPid != null) {
// 如果是默认库位
midList.add(placeAndMaterialByMidAndPid.getMid());
}
}
} else {
// 如果不是默认库位
// 获取当前库位中存储的物料
List<MaterialAndPlace> placeAndMaterialByPid = placeService.findPlaceAndMaterialByPid(pid);
for (int i = 0; i < placeAndMaterialByPid.size(); i++) {
MaterialAndPlace materialAndPlace = placeAndMaterialByPid.get(i);
midList.add(materialAndPlace.getMid());
}
List<Material> materialByIds = materialService.findMaterialByIds(midList);
mv.addObject("materialList",materialByIds);
mv.addObject("mcode",mcode);
}
if (midList.size() > 0) {
List<Inventory> materialByIds = materialService.findMaterialByIds(midList);
mv.addObject("materialList", materialByIds);
}
mv.addObject("mcode", mcode);
mv.setViewName("pages/scanQrCode/ScanBarOrQrCodeOut_selectMaterial");
return mv;
}

11
src/main/java/com/dreamchaser/depository_manage/controller/PlaceController.java

@ -4,10 +4,7 @@ import cn.hutool.core.lang.Snowflake;
import com.baomidou.mybatisplus.extension.api.R;
import com.dreamchaser.depository_manage.entity.*;
import com.dreamchaser.depository_manage.exception.MyException;
import com.dreamchaser.depository_manage.pojo.MaterialP;
import com.dreamchaser.depository_manage.pojo.PlaceP;
import com.dreamchaser.depository_manage.pojo.RestResponse;
import com.dreamchaser.depository_manage.pojo.StatusInfo;
import com.dreamchaser.depository_manage.pojo.*;
import com.dreamchaser.depository_manage.service.DepositoryService;
import com.dreamchaser.depository_manage.service.MaterialService;
import com.dreamchaser.depository_manage.service.PlaceService;
@ -59,7 +56,7 @@ public class PlaceController {
StringBuilder mname = new StringBuilder();
for (int j = 0; j < placeAndMaterialByPid.size(); j++) {
Integer mid = placeAndMaterialByPid.get(j).getMid();
Material materialById = materialService.findMaterialById(mid);
Inventory materialById = materialService.findInventoryByMid(mid);
mname.append(materialById.getMname()+",");
}
placeP.setMname(mname.toString());
@ -229,11 +226,11 @@ public class PlaceController {
// 根据物料编码以及仓库编号获取具体库位
@PostMapping("/findPlaceByMcodeAndDid")
public RestResponse findPlaceByMcodeAndDid(@RequestBody Map<String,Object> map,HttpServletRequest request){
List<MaterialP> inventory = materialService.findInventory(map);
List<InventoryP> inventory = materialService.findInventory(map);
List<PlaceP> placeList = new ArrayList<>();
if(inventory.size() > 0){ // 如果有当前物料
for (int i = 0; i < inventory.size(); i++) {
MaterialP materialP = inventory.get(i);
InventoryP materialP = inventory.get(i);
List<PlaceP> placeByMidAndDid = placeService.findPlaceByMidAndDid(materialP.getId(), ObjectFormatUtil.toInteger(map.get("depositoryId")));
for (int j = 0; j < placeByMidAndDid.size(); j++) {
int index = placeList.indexOf(placeByMidAndDid.get(j));

2
src/main/java/com/dreamchaser/depository_manage/entity/ExcelInfoByInventory.java

@ -18,7 +18,7 @@ public class ExcelInfoByInventory {
private String id;
/** 存货编码 */
@ExcelProperty(value = "编码",converter = ExcelMaterialCodeConverter.class)
@ExcelProperty(value = "编码")
private String code;
/** 仓库名称 */

148
src/main/java/com/dreamchaser/depository_manage/entity/Inventory.java

@ -0,0 +1,148 @@
package com.dreamchaser.depository_manage.entity;
import lombok.Data;
import java.util.List;
@Data
public class Inventory {
/**
* 存储id
*/
private Integer id;
/**
* 物料id
*/
private Integer mid;
/**
* 仓库id
*/
private Integer depositoryId;
/**
* 物料名称
*/
private String mname;
/**
* 数量
*/
private Integer quantity;
/**
* 总金额
*/
private Double amounts;
/**
* 物料种类id
*/
private Long materialTypeId;
/**
* 物料状态
*/
private Integer state;
/**
* 存货编码
*/
private String code;
/**
* 规格型号
*/
private String version;
/**
* 单价
*/
private Double price;
/**
* 类型名称
*/
private String typeName;
/**
* 物料编码与条形码的对应关系
*/
private List<MaterialAndBarCode> materialAndBarCodeList;
/**
* 物料类型
*/
private MaterialType materialType;
/**
* 所属仓库
*/
private Depository depository;
/**
* 计量单位
*/
private String unit;
/**
* 材质
*/
private String texture;
/**
* 仓库编码
*/
private String depositoryCode;
/**
* 库位编码
*/
private String placeCode;
/**
* 暂存额度
*/
private Integer numberOfTemporary;
/**
* 生产日期
*/
private Long producedDate;
/**
* 保质期
*/
private Long shelfLife;
/**
* 产地
*/
private String productionPlace;
/**
* 生产日期
*/
private String brand;
/**
* 备注
*/
private String remark;
/**
* 生产日期
*/
private String showProducedDate;
/**
* 保质期
*/
private String showShelfLife;
}

5
src/main/java/com/dreamchaser/depository_manage/entity/MaterialAndBarCode.java

@ -27,6 +27,11 @@ public class MaterialAndBarCode {
* 物料id
*/
private Integer mid;
/**
* 库存id
*/
private Integer iid;
/**
* 仓库id
*/

4
src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryMapper.xml

@ -335,7 +335,7 @@
<select id="getToDayInventoryByDName" resultType="int" parameterType="map">
select ifnull(sum(quantity),0.0)
from depositoryAndmaterial
from depositoryandinventory
where 1 = 1
<if test="dname != null and dname !=''">
and dname = #{dname}
@ -347,7 +347,7 @@
<select id="getToDayInventoryByDNameTest" resultMap="inventoryByDname">
select ifnull(sum(quantity),0.0) as inventory ,dname
from depositoryAndmaterial
from depositoryandinventory
where 1 = 1
GROUP BY dname
</select>

2
src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.java

@ -200,7 +200,7 @@ public interface DepositoryRecordMapper {
* @param map
* @return
*/
Double findApplicationOutByMonth(Map<String,Object> map);
Integer findApplicationOutByMonth(Map<String,Object> map);
/**
* 查询仓库当天流水

8
src/main/java/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml

@ -1184,7 +1184,7 @@
</select>
<!-- 获取某月某物料出库总额-->
<select id="findApplicationOutByMonth" parameterType="map" resultType="DOUBLE">
<select id="findApplicationOutByMonth" parameterType="map" resultType="int">
select ifnull(sum(aorquantity),0)
from applicationoutrecordinfo
where 1 = 1
@ -1203,6 +1203,12 @@
<if test="tname != null and tname != ''">
and tname = #{tname}
</if>
<if test="list != null">
and mtid in
<foreach collection="list" index="index" item="typeId" open="(" separator="," close=")">
#{typeId}
</foreach>
</if>
</select>

60
src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.java

@ -1,9 +1,6 @@
package com.dreamchaser.depository_manage.mapper;
import com.dreamchaser.depository_manage.entity.ExcelInfo;
import com.dreamchaser.depository_manage.entity.Material;
import com.dreamchaser.depository_manage.entity.MaterialAndBarCode;
import com.dreamchaser.depository_manage.entity.MaterialAndProducedDate;
import com.dreamchaser.depository_manage.entity.*;
import com.dreamchaser.depository_manage.pojo.MaterialP;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@ -19,30 +16,55 @@ import java.util.Map;
public interface MaterialMapper {
/**
* 增加一条库存记录
* 增加一条物料信息
*
* @param map 参数map
* @return 受影响的行数
*/
Integer insertMaterial(Map<String, Object> map);
/**
* 增加一条库存记录
* 增加一条物料信息
*
* @param material
* @return 受影响的行数
*/
Integer insertMaterial(Material material);
/**
* 增加库存记录
* 增加物料信息
*
* @param list 参数map
* @return 受影响的行数
*/
Integer insertMaterials(List<ExcelInfo> list);
/**
* 更新一条库存记录
* 增加一条库存信息
*
* @param map 参数map
* @return 受影响的行数
*/
Integer insertInventory(Map<String, Object> map);
/**
* 增加一条物料信息
*
* @param inventory
* @return 受影响的行数
*/
Integer insertInventory(Inventory inventory);
/**
* 更新一条物料信息
*
* @param map 参数列表
* @return 受影响的行数
@ -50,7 +72,7 @@ public interface MaterialMapper {
Integer updateMaterial(Map<String, Object> map);
/**
* 更新一条库存记录
* 更新一条物料信息
* @param material 修改的参数
* @return 受影响的行数
*/
@ -66,10 +88,10 @@ public interface MaterialMapper {
/**
* 更新一条库存记录
* @param material 修改的参数
* @param inventory 修改的参数
* @return 受影响的行数
*/
Integer updateInventory(Material material);
Integer updateInventory(Inventory inventory);
/**
* 将对应仓库id和物料名称的库存修改数量和价格
@ -112,7 +134,7 @@ public interface MaterialMapper {
* @param map
* @return
*/
List<Material> findInventory(Map<String,Object> map);
List<Inventory> findInventory(Map<String,Object> map);
/**
* 根据id查询库存信息
@ -121,6 +143,14 @@ public interface MaterialMapper {
*/
Material findMaterialById(int id);
/**
* 根据物料id查询库存信息
* @param mid 库存id
* @return 库存信息
*/
Inventory findInventoryByMid(int mid);
/**
* 根据id查询库存信息
@ -134,7 +164,7 @@ public interface MaterialMapper {
* @param list 库存id集合
* @return 库存信息
*/
List<Material> findMaterialByIds(List<Integer> list);
List<Inventory> findInventoryByIds(List<Integer> list);
/**
* 查询所有库存条数
@ -181,7 +211,7 @@ public interface MaterialMapper {
* @param map
* @return
*/
List<Material> findMaterialByDepositorysAndType(Map<String,Object> map);
List<Inventory> findMaterialByDepositorysAndType(Map<String,Object> map);
@ -190,7 +220,7 @@ public interface MaterialMapper {
* @param map
* @return
*/
List<Material> findMaterialByDepository(Map<String,Object> map);
List<Inventory> findMaterialByDepository(Map<String,Object> map);
/**
* 根据仓库查询物品数目

191
src/main/java/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml

@ -27,6 +27,32 @@
<result column="remark" property="remark" jdbcType="VARCHAR"/>
</resultMap>
<!-- 字段映射 -->
<resultMap id="InventoryMap" type="com.dreamchaser.depository_manage.entity.Inventory">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="mid" property="mid" jdbcType="INTEGER"/>
<result column="depositoryId" property="depositoryId" jdbcType="INTEGER" />
<result column="mname" property="mname" jdbcType="VARCHAR" />
<result column="quantity" property="quantity" jdbcType="VARCHAR" />
<result column="price" property="price" jdbcType="INTEGER" />
<result column="mtid" property="materialTypeId" jdbcType="INTEGER" />
<result column="mstate" property="state" jdbcType="INTEGER" />
<result column="mcode" property="code" jdbcType="VARCHAR"/>
<result column="version" property="version" jdbcType="VARCHAR"/>
<result column="amounts" property="amounts" jdbcType="INTEGER"/>
<result column="unit" property="unit" jdbcType="VARCHAR"/>
<result column="texture" property="texture" jdbcType="VARCHAR"/>
<result column="producedDate" property="producedDate" jdbcType="INTEGER"/>
<result column="shelfLife" property="shelfLife" jdbcType="INTEGER"/>
<result column="productionPlace" property="productionPlace" jdbcType="VARCHAR"/>
<result column="brand" property="brand" jdbcType="VARCHAR"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/>
<result column="numberOfTemporary" property="numberOfTemporary" jdbcType="INTEGER"/>
</resultMap>
<!-- 字段映射-->
<resultMap id="materialAndTypeMap" type="com.dreamchaser.depository_manage.entity.Material">
<id column="id" property="id" jdbcType="INTEGER" />
@ -85,15 +111,12 @@
<result column="mcode" property="mcode" jdbcType="VARCHAR"/>
<result column="bmcode" property="bmcode" jdbcType="VARCHAR"/>
<result column="mid" property="mid" jdbcType="INTEGER"/>
<result column="iid" property="iid" jdbcType="INTEGER"/>
<result column="mtid" property="mtid" jdbcType="INTEGER"/>
<result column="shelfLife" property="shelfLife" jdbcType="INTEGER"/>
</resultMap>
<!-- 表查询字段 -->
<sql id="allColumns">
m.id, m.depository_id, m.mname, m.quantity, m.price, m.type_id,m.state,m.code ,m.version ,m.amounts ,m.unit ,m.texture,m.depositoryCode,m.number_of_temporary,m.shelfLife,m.producedDate,m.productionPlace,m.brand,m.remark
@ -108,6 +131,10 @@
<sql id="allColumnsAndTypeNameOnView">
id,depository_id,mname,quantity,price,type_id,state,tname,dname,version,amounts ,unit ,texture,code,depositoryCode,producedDate,shelfLife,productionPlace,brand,remark
</sql>
<!-- 表查询字段,包括物料类型 用于库存视图-->
<sql id="allColumnsAndTypeNameOnViewByInventory">
id,mid,depositoryId,mname,quantity,price,mtid,mstate,tname,dname,version,amounts ,unit ,texture,mcode,depositoryCode,producedDate,shelfLife,productionPlace,brand,remark,numberOfTemporary
</sql>
<sql id="allColumnsByMaterialAndProducedDate">
mp.id,mp.inid,mp.mid,mp.quantity,mp.expendnum,mp.inventory,mp.producedDate,mp.barCode,mp.qrCode
@ -178,12 +205,12 @@
<if test="mid != null">
and id = #{mid}
</if>
<if test="depositoryId != null">
AND depository_id = #{depositoryId}
</if>
<if test="mname != null and mname != ''">
AND mname LIKE CONCAT('%', #{mname}, '%')
</if>
<if test="version != null">
and version = #{version}
</if>
<if test="quantity != null">
AND quantity = #{quantity}
</if>
@ -243,20 +270,23 @@
</select>
<!--根据条件查询库存-->
<select id="findInventory" resultMap="materialMap" parameterType="map">
<select id="findInventory" resultMap="InventoryMap" parameterType="map">
SELECT
<include refid="allColumnsAndTypeNameOnView" />
from findMaterial
<include refid="allColumnsAndTypeNameOnViewByInventory" />
from findInventory
where 1 = 1
<if test="mid != null">
and id = #{mid}
and mid = #{mid}
</if>
<if test="depositoryId != null">
AND depository_id = #{depositoryId}
AND depositoryId = #{depositoryId}
</if>
<if test="mname != null and mname != ''">
AND mname LIKE CONCAT('%', #{mname}, '%')
</if>
<if test="version != null">
and version = #{version}
</if>
<if test="quantity != null">
AND quantity = #{quantity}
</if>
@ -264,13 +294,13 @@
AND price = #{price}
</if>
<if test="materialTypeId != null">
AND type_id = #{materialTypeId}
AND mtid = #{materialTypeId}
</if>
<if test="state != null and state != ''">
And state = #{state}
And mstate = #{state}
</if>
<if test="code != null and code != '' ">
and code = #{code}
<if test="mcode != null and mcode != '' ">
and mcode = #{mcode}
</if>
<if test="shelfLife != null">
and #{shelfLife} >= shelfLife
@ -287,7 +317,6 @@
<if test="remark != '' and remark != null">
and remark LIKE CONCAT('%', #{remark}, '%')
</if>
and depository_id is not null
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
@ -342,17 +371,20 @@
<select id="findInventoryCount" parameterType="map" resultType="int">
SELECT
count(*)
from findMaterial
from findInventory
where 1 = 1
<if test="mid != null">
and id = #{mid}
and mid = #{mid}
</if>
<if test="depositoryId != null">
AND depository_id = #{depositoryId}
AND depositoryId = #{depositoryId}
</if>
<if test="mname != null and mname != ''">
AND mname LIKE CONCAT('%', #{mname}, '%')
</if>
<if test="version != null">
and version = #{version}
</if>
<if test="quantity != null">
AND quantity = #{quantity}
</if>
@ -360,13 +392,13 @@
AND price = #{price}
</if>
<if test="materialTypeId != null">
AND type_id = #{materialTypeId}
AND mtid = #{materialTypeId}
</if>
<if test="state != null and state != ''">
And state = #{state}
And mstate = #{state}
</if>
<if test="code != null and code != '' ">
and code = #{code}
<if test="mcode != null and mcode != '' ">
and mcode = #{mcode}
</if>
<if test="shelfLife != null">
and #{shelfLife} >= shelfLife
@ -383,15 +415,15 @@
<if test="remark != '' and remark != null">
and remark LIKE CONCAT('%', #{remark}, '%')
</if>
and depository_id is not null
</select>
<!-- 根据仓库查询物料-->
<select id="findMaterialByDepositorys" resultMap="materialMap" parameterType="list">
<select id="findMaterialByDepositorys" resultMap="InventoryMap" parameterType="list">
SELECT
<include refid="allColumns" />
from material m
where m.depository_id in
<include refid="allColumnsAndTypeNameOnViewByInventory" />
from findInventory
where depositoryId in
<foreach collection="list" index="index" item="item" open="("
separator="," close=")">
#{item}
@ -399,7 +431,7 @@
</select>
<select id="findMaterialByTypeIds" resultMap="materialMap" parameterType="list">
<select id="findMaterialByTypeIds" resultMap="InventoryMap" parameterType="list">
SELECT
<include refid="allColumns" />
from material m
@ -411,16 +443,16 @@
and state = 1;
</select>
<select id="findMaterialByDepositorysAndType" resultMap="materialMap" parameterType="map">
<select id="findMaterialByDepositorysAndType" resultMap="InventoryMap" parameterType="map">
SELECT
<include refid="allColumns" />
from material m
where m.depository_id in
<include refid="allColumnsAndTypeNameOnViewByInventory" />
from findInventory
where depositoryId in
<foreach collection="list" index="index" item="item" open="("
separator="," close=")">
#{item}
</foreach>
and m.type_id = #{materialTypeId}
and mtid = #{materialTypeId}
</select>
<!-- 根据条形码查询物料-->
@ -498,11 +530,11 @@
<!-- 根据仓库查询物料-->
<select id="findMaterialByDepository" resultMap="materialMap" parameterType="map">
<select id="findMaterialByDepository" resultMap="InventoryMap" parameterType="map">
SELECT
<include refid="allColumns" />
from material m
where m.depository_id = #{depositoryId}
<include refid="allColumnsAndTypeNameOnViewByInventory" />
from findInventory
where depositoryId = #{depositoryId}
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
@ -512,8 +544,8 @@
<select id="findMaterialByDepositoryCount" resultType="int" parameterType="map">
SELECT
COUNT(*)
from material m
where m.depository_id = #{depositoryId}
from findInventory
where depositoryId = #{depositoryId}
</select>
@ -524,6 +556,12 @@
FROM material m WHERE m.id =#{id}
</select>
<select id="findInventoryByMid" resultMap="InventoryMap" parameterType="integer">
SELECT
<include refid="allColumnsAndTypeNameOnViewByInventory" />
FROM findInventory WHERE id =#{mid}
</select>
<select id="findMaterialAndTypeById" resultMap="materialAndTypeMap" parameterType="integer">
select
<include refid="allColumnsAndTypeName"/>
@ -540,10 +578,10 @@
<!-- 根据主键查询数据 -->
<select id="findMaterialByIds" resultMap="materialMap" parameterType="list">
<select id="findInventoryByIds" resultMap="InventoryMap" parameterType="list">
SELECT
<include refid="allColumns" />
FROM material m WHERE m.id IN
<include refid="allColumnsAndTypeNameOnViewByInventory" />
FROM findInventory WHERE id IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
@ -599,7 +637,19 @@
#{remark}
)
</insert>
<!-- 插入数据 -->
<insert id="insertInventory" useGeneratedKeys="true" keyProperty="id">
insert into inventory(id,mid,quantity,amounts,price,producedDate,depository_id)
values (
#{id},
#{mid},
#{quantity},
#{amounts},
#{price},
#{producedDate},
#{depositoryId}
)
</insert>
<!-- 添加当前批次物料与生产日期对应-->
<insert id="addMaterialAndProducedDate" useGeneratedKeys="true" keyProperty="id">
insert into materialandproduceddate(id,inid,mid,quantity,expendnum,inventory,producedDate,barCode,qrCode)
@ -775,59 +825,28 @@
<!-- 修改数据 -->
<update id="updateInventory">
UPDATE material
UPDATE inventory
<set>
<if test="depositoryId != null">
depository_id = #{depositoryId},
</if>
<if test="mname != null">
mname = #{mname},
</if>
<if test="materialTypeId != null">
type_id = #{materialTypeId},
</if>
<if test="state != null and state != ''">
state = #{state},
</if>
<if test="version != null and version != ''">
version = #{version},
</if>
<if test="code != null and code != ''">
code = #{code},
</if>
<if test="unit != null and unit != ''">
unit = #{unit},
</if>
<if test="depositoryCode != null and depositoryCode !=''">
depositoryCode = #{depositoryCode},
</if>
<if test="numberOfTemporary != null">
number_of_temporary = #{numberOfTemporary},
</if>
<if test="texture != null and texture != ''">
texture = #{texture},
</if>
<if test="shelfLife != null">
shelfLife = #{shelfLife},
<if test="mid != null and mid != '' ">
mid = #{mid},
</if>
<if test="producedDate != null">
producedDate = #{producedDate},
</if>
<if test="productionPlace != null and productionPlace !=''">
productionPlace = #{productionPlace},
<if test="quantity != null">
quantity = #{quantity},
</if>
<if test="brand != '' and brand != null">
brand = #{brand},
<if test="price != null">
price = #{price},
</if>
<if test="remark != '' and remark != null">
remark = #{remark}
<if test="amounts != null and amounts != ''">
amounts = #{amounts},
</if>
</set>
WHERE id in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
WHERE id = #{id}
</update>
<!-- 根据仓库id和物料名称改变物料的数量 -->

5
src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationModel.java

@ -30,6 +30,11 @@ public class ApplicationModel {
* 物料编号
*/
private Integer mid;
/**
* 库存编号
*/
private Integer iid;
/**
* 申请人编号
*/

204
src/main/java/com/dreamchaser/depository_manage/pojo/InventoryP.java

@ -0,0 +1,204 @@
package com.dreamchaser.depository_manage.pojo;
import com.dreamchaser.depository_manage.entity.Inventory;
import com.dreamchaser.depository_manage.entity.Material;
import com.dreamchaser.depository_manage.entity.MaterialAndBarCode;
import lombok.Data;
import java.util.List;
@Data
public class InventoryP {
/**
* 存储id
*/
private Integer id;
/**
* 物料id
*/
private Integer mid;
/**
* 仓库名称
*/
private String depositoryName;
/**
* 仓库id
*/
private Integer depositoryId;
/**
* 物料名称
*/
private String mname;
/**
* 数量
*/
private Integer quantity;
/**
* 总金额
*/
private Double amounts;
/**
* 物料种类名称
*/
private String typeName;
/**
* 物料种类编码
*/
private Long typeId;
/**
* 物料状态
*/
private Integer state;
/**
* 仓库名称
*/
private String dName;
/**
* 金额
*/
private Double price;
/**
* 计量单位
*/
private String unit;
/**
* 材质
*/
private String texture;
/**
* 存货编码
*/
private String code;
/**
* 规格型号
*/
private String version;
/**
* 仓库编号
*/
private String depositoryCode;
/**
* 仓库管理员
*/
private String warehouseManager;
/**
* 库位编码
*/
private String placeCode;
/**
* 物料编码与条形码的对应关系
*/
private List<MaterialAndBarCode> materialAndBarCodeList;
/**
* 物料所处库位
*/
private List<PlaceP> placePList;
/**
* 生产日期
*/
private String producedDate;
/**
* 保质期
*/
private String shelfLife;
/**
* 产地
*/
private String productionPlace;
/**
* 品牌
*/
private String brand;
/**
* 备注
*/
private String remark;
/**
* 保质期用于计算
*/
private Long shelfLifeForCalc;
/**
* 保质期,用于表格展示
*/
private String tableShowShelfLife;
/**
* 预警数量
*/
private Integer warningCount;
/**
* 该物料生产日期列表
*/
private List<String> producedDateList;
public InventoryP(Integer id, Integer depositoryId, String mname, Integer quantity, Double price, String typeName) {
this.id = id;
this.mname = mname;
this.quantity = quantity;
this.price = price;
this.typeName = typeName;
}
public InventoryP(Inventory inventory) {
this.id = inventory.getId(); // 编号
this.mid = inventory.getMid(); // 编号
this.mname = inventory.getMname(); // 物料名称
this.quantity = inventory.getQuantity(); // 数量
this.price = inventory.getPrice(); // 单价
this.state = inventory.getState(); // 物料状态
this.amounts = inventory.getAmounts(); // 总额
this.unit = inventory.getUnit(); // 计量单位
this.texture = inventory.getTexture(); // 材质
this.code = inventory.getCode(); // 存货编码
this.version = inventory.getVersion(); // 规格型号
this.depositoryCode = inventory.getDepositoryCode(); // 仓库编码
this.depositoryId = inventory.getDepositoryId(); // 仓库id
this.placeCode = inventory.getPlaceCode(); // 库位编码
this.productionPlace = inventory.getProductionPlace(); // 产地
this.brand = inventory.getBrand(); // 品牌
this.remark = inventory.getRemark(); // 备注
this.shelfLifeForCalc = inventory.getShelfLife(); //保质期,用于计算
}
public InventoryP() {
}
}

6
src/main/java/com/dreamchaser/depository_manage/pojo/MaterialP.java

@ -20,6 +20,11 @@ public class MaterialP {
*/
private Integer id;
/**
* 物料id
*/
private Integer mid;
/**
* 仓库名称
*/
@ -181,6 +186,7 @@ public class MaterialP {
public MaterialP(Material material) {
this.id = material.getId(); // 编号
this.mid = material.getId();
this.mname = material.getMname(); // 物料名称
this.quantity = material.getQuantity(); // 数量
this.price = material.getPrice(); // 单价

8
src/main/java/com/dreamchaser/depository_manage/service/DepositoryService.java

@ -143,6 +143,14 @@ public interface DepositoryService {
*/
List<Depository> findDepositoryByAdminorg(String adminorg);
/**
* 根据仓库构造库位的树形选择框
* @param depositoryId 仓库id
* @return
*/
List<Object> InitTreeMenus_Place(Integer depositoryId);
/**
* 根据仓库编码获取仓库
* @param code

36
src/main/java/com/dreamchaser/depository_manage/service/MaterialService.java

@ -1,6 +1,7 @@
package com.dreamchaser.depository_manage.service;
import com.dreamchaser.depository_manage.entity.*;
import com.dreamchaser.depository_manage.pojo.InventoryP;
import com.dreamchaser.depository_manage.pojo.MaterialP;
import java.util.List;
@ -54,7 +55,16 @@ public interface MaterialService {
* @param map
* @return
*/
List<MaterialP> findInventory(Map<String,Object> map);
List<InventoryP> findInventory(Map<String,Object> map);
/**
* 根据条件查询符合条件的库存
* @param map
* @return
*/
List<MaterialP> findMaterial(Map<String,Object> map);
/**
* 根据条件查询符合条件的库存总数
@ -91,6 +101,13 @@ public interface MaterialService {
*/
Material findMaterialById(int id);
/**
* 根据物料id查询库存信息
* @param id 库存物料id
* @return 库存信息
*/
Inventory findInventoryByMid(int id);
/**
* 根据id查询库存信息
* @param id 库存id
@ -102,7 +119,7 @@ public interface MaterialService {
* @param ids 库存id集合
* @return 库存信息
*/
List<Material> findMaterialByIds(List<Integer> ids);
List<Inventory> findMaterialByIds(List<Integer> ids);
/**
* 查询所有库存条数
@ -181,7 +198,7 @@ public interface MaterialService {
* @param map
* @return
*/
List<MaterialP> findMaterialByDepository(Map<String,Object> map);
List<InventoryP> findInventoryByDepository(Map<String,Object> map);
/**
* 根据仓库查询物品数目
@ -197,7 +214,7 @@ public interface MaterialService {
* @param map 参数map
* @return 受影响的行数
*/
Integer insertMaterialForImport(Map<String, Object> map);
Integer insertInventoryForImport(Map<String, Object> map);
/**
* 通过条形码获取物料信息
@ -298,5 +315,16 @@ public interface MaterialService {
*/
void closeTreeChildren(Long mtId);
/**
* 用于构造物料数新算法
* @return
*/
List<Object> InitMaterialTree_New();
/**
* 用于修改库位中的物料
* @param map 修改条件
* @return
*/
Integer editPlaceMaterial(Map<String,Object> map);
}

11
src/main/java/com/dreamchaser/depository_manage/service/PlaceService.java

@ -126,6 +126,13 @@ public interface PlaceService {
*/
Integer updateMaterialAndPlace(MaterialAndPlace mp);
/**
* 删除当前库位与物料的对应关系
* @param id 主键id
* @return
*/
Integer deleteMaterialAndPlace(Integer id);
/**
* 获取库位对应的二维码
* @param pid
@ -146,4 +153,8 @@ public interface PlaceService {
* 根据二维码的值获取对应位置
*/
PidOrDidAndCode findLocationByQrCode(String qrCode);
}

123
src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

@ -96,10 +96,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
temp.put("dcode", depositoryRecordById.getCode());
// 获取当前仓库库存
Integer Inventory = depositoryMapper.getToDayInventoryByDName(temp);
String code = createCode(depositoryRecordById.getDname(), "InOrderNumber", "in", "");//构造单号
//构造单号
String code = createCode(depositoryRecordById.getDname(), "InOrderNumber", "in", "");
Double quantity = Double.parseDouble((String) map.get("quantity"));
Double price = Double.parseDouble((String) map.get("price"));
Integer mid = ObjectFormatUtil.toInteger(map.get("mid"));
// 根据物料id查询物料
Material material = materialMapper.findMaterialById(mid);
// 判断剩余容量是否可以存入
if (depositoryRecordById.getMaxNumber() - Inventory < quantity) {
@ -112,14 +114,14 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
if(s == null || "".equals(s.toString())){
producedDate = Long.valueOf(0);
}else{
producedDate = DateUtil.DateTimeByMonthToTimeStamp(s.toString());
producedDate = DateUtil.DateTimeByDayToTimeStamp(s.toString());
}
}
Map<String, Object> param = new HashMap<>();
param.put("depositoryId", depositoryId);
param.put("code", material.getCode());
// 判断该仓库中有无该物
List<Material> materialByCondition = materialMapper.findInventory(param);
param.put("mcode", material.getCode());
// 判断该仓库中有无该物物料
List<Inventory> materialByCondition = materialMapper.findInventory(param);
// 获取当前入库金额
Double amounts = (quantity * price * 100);
// 获取平均价格
@ -131,36 +133,29 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
map.put("code", code);
// 获取当前物料
// 获取当前入库物料id
Integer newMid = 0;
if (materialByCondition.size() > 0) { // 如果当前存在
Material mt = materialByCondition.get(0);
Inventory mt = materialByCondition.get(0);
map.put("oldPrice", mt.getPrice());
map.put("mid", mt.getId());
map.put("mid", mt.getMid());
mt.setAmounts(mt.getAmounts() + amounts);
mt.setQuantity((int) (mt.getQuantity() + quantity));
mt.setPrice(avgPrice);
mt.setProducedDate(producedDate);
materialMapper.updateMaterial(mt);
materialMapper.updateInventory(mt);
newMid = mt.getId();
} else {
Map<String, Object> insert = new HashMap<>();
Material materialById = materialMapper.findMaterialById(mid);
insert.put("depositoryId", depositoryId);
insert.put("price", avgPrice);
insert.put("mname", materialById.getMname());
insert.put("quantity", quantity);
insert.put("materialTypeId", materialById.getMaterialTypeId());
insert.put("code", materialById.getCode());
insert.put("unit", materialById.getUnit());
insert.put("version", materialById.getVersion());
insert.put("texture", materialById.getTexture());
insert.put("amounts", amounts);
insert.put("depositoryCode", materialById.getDepositoryCode());
insert.put("shelfLife", materialById.getShelfLife());
insert.put("producedDate", producedDate);
materialMapper.insertMaterial(insert);
insert.put("mid",map.get("mid"));
materialMapper.insertInventory(insert);
newMid = ObjectFormatUtil.toInteger(insert.get("id"));
}
// 将新入库的物料id记录下来
@ -194,7 +189,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
map.put("state", "待部门负责人审核");
if (mid != null) {
// 获取当前物料
Material materialById = materialMapper.findMaterialById(mid);
Inventory materialById = materialMapper.findInventoryByMid(mid);
int amounts = (int) ((materialById.getPrice() / 100) * quantity * 100);
map.put("price", amounts);
Map<String, Object> update = new HashMap<>();
@ -498,7 +493,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
ApplicationOutRecordMin recordMin = minList.get(i);
count +=recordMin.getQuantity();
// 获取当前出库物料
Material materialById = materialMapper.findMaterialById(recordMin.getMid());
Inventory materialById = materialMapper.findInventoryByMid(recordMin.getMid());
// 计算当前出库金额
double price_out = materialById.getPrice() * recordMin.getQuantity();
BigDecimal bg = new BigDecimal(price_out / 100);
@ -551,7 +546,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
if(s == null || "".equals(s.toString())){
producedDate = Long.valueOf(0);
}else{
producedDate = DateUtil.DateTimeByMonthToTimeStamp(s.toString());
producedDate = DateUtil.DateTimeByDayToTimeStamp(s.toString());
insertProducedDate.put("producedDate", producedDate);
}
}
@ -576,15 +571,16 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}
// 获取当前库存记录
Map<String, Object> param = new HashMap<>();
param.put("code", materialById.getCode());
param.put("mcode", materialById.getCode());
param.put("mname", materialById.getMname());
if (placeId == 0) {
param.put("depositoryId", map.get("depositoryId"));
} else {
param.put("depositoryId", placeById.getDid());
}
List<Material> inventory = materialMapper.findInventory(param);
Material material = inventory.get(0);
List<Inventory> inventory = materialMapper.findInventory(param);
// 获取当前库存
Inventory material = inventory.get(0);
Map<String, Object> insert = new HashMap<>();
insert.put("mid", material.getId());
@ -667,7 +663,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
@Override
public Integer insertApplicationOutMin(Map<String, Object> map) {
Integer mid = ObjectFormatUtil.toInteger(map.get("mid"));
Material materialById = materialMapper.findMaterialById(mid);
Inventory materialById = materialMapper.findInventoryByMid(mid);
map.put("depositoryId", materialById.getDepositoryId());
map.put("trueOut",0);
return depositoryRecordMapper.insertApplicationOutRecordMin(map);
@ -736,6 +732,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 获取要完成的子订单
ApplicationOutRecordMin applicationOutMinById = depositoryRecordMapper.findApplicationOutMinById(id);
// 获取子订单中对应的库存id
Integer mid = applicationOutMinById.getMid();
// 获取库存信息
Inventory inventory = materialMapper.findInventoryByMid(mid);
// 获取子订单对应的主订单
ApplicationOutRecordP record = depositoryRecordMapper.findApplicationOutRecordPById(applicationOutMinById.getParentId());
// 设置标志位
@ -758,7 +759,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
MaterialAndPlace placeAndMaterialByMidAndPid = null;
if (placeId != 0) { // 如果不是默认库位
Map<String, Object> params = new HashMap<>();
params.put("mid", applicationOutMinById.getMid());
params.put("mid", inventory.getId());
params.put("pid", placeId);
// 获取当前物料所存放库位的数量
placeAndMaterialByMidAndPid = placeMapper.findPlaceAndMaterialByMidAndPid(params);
@ -776,7 +777,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}
} else { // 如果是默认库位
Map<String, Object> params = new HashMap<>();
params.put("mid", applicationOutMinById.getMid());
params.put("mid", inventory.getId());
params.put("pid", 0);
// 获取当前物料在默认库位中的数量
placeAndMaterialByMidAndPid = placeMapper.findPlaceAndMaterialByMidAndPid(params);
@ -793,19 +794,18 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
return restResponse;
}
}
// 获取出库物料具体信息
Material material = materialMapper.findMaterialById(applicationOutMinById.getMid());
// 如果物料数量可以出库并且库位数量充足
if (material.getQuantity() >= trueOut && flag) {
if (inventory.getQuantity() >= trueOut && flag) {
// 当前出库金额
Double sum = material.getPrice() * trueOut;
Double sum = inventory.getPrice() * trueOut;
// 当前出库数量
Integer quantity = trueOut;
material.setAmounts(material.getAmounts() - sum);
material.setQuantity(material.getQuantity() - quantity);
material.setNumberOfTemporary(material.getNumberOfTemporary() - quantity);
inventory.setAmounts(inventory.getAmounts() - sum);
inventory.setQuantity(inventory.getQuantity() - quantity);
inventory.setNumberOfTemporary(inventory.getNumberOfTemporary() - quantity);
// 修改物料信息
materialMapper.updateMaterial(material);
materialMapper.updateInventory(inventory);
if (placeAndMaterialByMidAndPid != null) { //如果库位不为空
// 修改当前库位存放物料的数量
@ -829,7 +829,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
applicationOutMinById.setTrueOut(trueOut+applicationOutMinById.getTrueOut());
if(applicationOutMinById.getQuantity() - applicationOutMinById.getTrueOut() > 0){
// 如果当前子订单中的物料并未完全出库
depositoryRecordMapper.updateApplicationOutRecordMin(applicationOutMinById);
}else{
// 如果完成出库
@ -892,15 +892,16 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
int index = code.indexOf(conpanyName);
// 生产新子订单编号
String newCode = code.replace(index, index + conpanyName.length(), depositoryName).toString();
// 设置新编码
applicationOutMinById.setCode(newCode);
// 设置完成人
applicationOutMinById.setCheckId(userByPort.getId());
// 设置新库位
applicationOutMinById.setPlaceId(placeId);
// 修改子订单
depositoryRecordMapper.updateApplicationOutRecordMin(applicationOutMinById);
String redisMainRecordKey = "record:" + record.getId(); // 设置redis中主订单键值
// 获取redis中主订单的所有子订单
@ -944,8 +945,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}
}
// 修改子订单
result += depositoryRecordMapper.updateApplicationOutRecordMin(applicationOutMinById);
// 如果是库存转移订单
Map<String, Object> map = new HashMap<>();
@ -965,7 +964,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
@Override
public void run() {
// 获取出库物料id
Integer mid = material.getId();
Integer mid = inventory.getId();
// 获取当前物料对应的生产日期
List<MaterialAndProducedDate> materialAndProducedDateByMid = materialMapper.findMaterialAndProducedDateByMid(mid);
if (materialAndProducedDateByMid.size() > 0) {
@ -1080,7 +1079,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 获取对应的物料编号
Integer mid = applicationOutRecordMin.getMid();
// 获取物料信息
Material materialById = materialMapper.findMaterialById(mid);
Inventory materialById = materialMapper.findInventoryByMid(mid);
// 获取该物料所处仓库的仓库管理员
List<Integer> userIdByDid = new ArrayList<>();
userIdByDid = roleService.findUserIdByDid(materialById.getDepositoryId());
@ -1216,7 +1215,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
public Integer transferApply(Map<String, Object> map, UserByPort userByPort) {
Integer mid = ObjectFormatUtil.toInteger(map.get("mid"));
Double quantity = Double.parseDouble((String) map.get("quantity"));
Material material = materialMapper.findMaterialById(mid);
Inventory material = materialMapper.findInventoryByMid(mid);
map.put("depositoryId", material.getDepositoryId());
map.put("mid", mid);
map.put("state", "待部门负责人审核");
@ -1261,6 +1260,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
map.remove("id");
map.put("parentId", id);
}
map.put("trueOut",0);
return depositoryRecordMapper.insertApplicationOutRecordMin(map);
}
@ -1745,46 +1745,43 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 获取转移详情
TransferRecord transferRecor = transferRecordMapper.findTransferRecordById(recordMin.getTransferId());
Integer mid = transferRecor.getMid();
Material material = materialMapper.findMaterialById(mid);
param.put("code", material.getCode());
// 获取库存信息
Inventory material = materialMapper.findInventoryByMid(mid);
param.put("mcode", material.getCode());
param.put("depositoryId", transferRecor.getToId());
List<Material> materiallist = materialMapper.findInventory(param);
List<Inventory> materiallist = materialMapper.findInventory(param);
if (materiallist.size() > 0) {
// 如果在该仓库
map.put("price", material.getPrice().toString());
map.put("depositoryId", transferRecor.getToId());
map.put("placeId", transferRecor.getToPlaceId());
map.put("mid", mid);
map.put("mid", material.getMid());
applicationInPlace(map);
} else {
// 如果不在该仓库,插入一条新记录
Map<String, Object> insert = new HashMap<>();
Material materialById = materialMapper.findMaterialById(mid);
Material materialById = materialMapper.findMaterialById(material.getMid());
Integer quantity = ObjectFormatUtil.toInteger(map.get("quantity"));
insert.put("depositoryId", transferRecor.getToId());
insert.put("price", materialById.getPrice());
insert.put("mname", materialById.getMname());
insert.put("price", material.getPrice());
insert.put("mid", materialById.getId());
insert.put("quantity", quantity);
insert.put("materialTypeId", materialById.getMaterialTypeId());
insert.put("code", materialById.getCode());
insert.put("unit", materialById.getUnit());
insert.put("version", materialById.getVersion());
insert.put("texture", materialById.getTexture());
insert.put("amounts", quantity * materialById.getPrice());
insert.put("depositoryCode", materialById.getDepositoryCode());
materialMapper.insertMaterial(insert);
insert.put("amounts", quantity * material.getPrice());
insert.put("depositoryCode", material.getDepositoryCode());
insert.put("producedDate",material.getProducedDate());
materialMapper.insertInventory(insert);
// 查询该记录
/*Integer id =ObjectFormatUtil.toInteger(insert.get("id"));
Material byId = materialMapper.findMaterialById(id);
*/
Map<String, Object> temp = new HashMap<>();
temp.put("code", materialById.getCode());
temp.put("mcode", materialById.getCode());
temp.put("depositoryId", transferRecor.getToId());
temp.put("mname", materialById.getMname());
List<Material> inventoryList = materialMapper.findInventory(temp);
List<Inventory> inventoryList = materialMapper.findInventory(temp);
// 获取该库存记录
Material inventory = inventoryList.get(0);
Inventory inventory = inventoryList.get(0);
Map<String, Object> fromPlaceTemp = new HashMap<>();
Map<String, Object> toPlaceTemp = new HashMap<>();
@ -1886,7 +1883,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}
if (map.containsKey("applyTime")) {
String applyTime = (String) map.get("applyTime");
map.put("applicantTime", DateUtil.DateTimeByMonthToTimeStamp(applyTime));
map.put("applicantTime", DateUtil.DateTimeByDayToTimeStamp(applyTime));
}
List<ApplicationInRecordP> list = depositoryRecordMapper.findApplicationInRecordPByCondition(map);
for (int i = 0; i < list.size(); i++) {
@ -1918,7 +1915,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}
if (map.containsKey("applyTime")) {
String applyTime = (String) map.get("applyTime");
map.put("applicantTime", DateUtil.DateTimeByMonthToTimeStamp(applyTime));
map.put("applicantTime", DateUtil.DateTimeByDayToTimeStamp(applyTime));
}
List<ApplicationOutRecordP> list = depositoryRecordMapper.findApplicationOutRecordPByCondition(map);
for (int i = 0; i < list.size(); i++) {
@ -2312,7 +2309,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
sumCount = depositoryRecordMapper.findApplicationInByMonthTest(map);
} else {
// 如果出库
sumCount = depositoryRecordMapper.findApplicationInByMonthTest(map);
sumCount = depositoryRecordMapper.findApplicationOutByMonth(map);
}
return sumCount;
}

21
src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryServiceImpl.java

@ -633,6 +633,27 @@ public class DepositoryServiceImpl implements DepositoryService {
return depositoryByAdminorg;
}
/**
* 根据仓库构造库位的树形选择框
* @param depositoryId 仓库id
* @return
*/
@Override
public List<Object> InitTreeMenus_Place(Integer depositoryId) {
// 根据仓库id查询对应的仓库
Depository depository = depositoryMapper.findDepositoryById(depositoryId);
// 定义结果列表
List<Object> result = new ArrayList<>();
// 获取当前仓库下的库位
List<Object> objectList = AddPlaceByDid(depository);
// 封装当前数据
Map<String, Object> map = InitTreeMenus2(depository, objectList);
// 添加到结果
result.add(map);
// 输出
return result;
}
/**
* 根据仓库编码获取仓库
*

62
src/main/java/com/dreamchaser/depository_manage/service/impl/ExcelServiceImpl.java

@ -2,6 +2,7 @@ package com.dreamchaser.depository_manage.service.impl;
import com.alibaba.fastjson.JSON;
import com.dreamchaser.depository_manage.entity.*;
import com.dreamchaser.depository_manage.pojo.MaterialP;
import com.dreamchaser.depository_manage.service.ExcelService;
import com.dreamchaser.depository_manage.service.MaterialService;
import com.dreamchaser.depository_manage.service.MaterialTypeService;
@ -234,8 +235,18 @@ public class ExcelServiceImpl implements ExcelService {
String mname = excelInfoByInventory.getMname();
// 获取当前库存明细规格
String version = excelInfoByInventory.getVersion();
// 用于查询当前物料中是否存在该记录
Map<String,Object> map = new HashMap<>();
map.put("mname",mname);
map.put("version",version);
List<MaterialP> materialPByCondition = materialService.findMaterialPByCondition(map);
if(materialPByCondition.size() == 0){
// 如果没有当前物料
String s = dataIndex.get(i);
String msg = s + "出现异常:" + excelInfoByInventory.getMname() + " 系统中并未存在该物料";
errMsg.add(msg);
continue;
}
String placeCode = excelInfoByInventory.getDepositoryCode();
Integer depositoryId = excelInfoByInventory.getDepositoryId();
// 如果导入时输入库位信息
@ -280,43 +291,44 @@ public class ExcelServiceImpl implements ExcelService {
List<Object> success = new ArrayList<>();
Map<String, Object> returnResult = new HashMap<>();
for (int i = 0; i < excelVos.size(); i++) {
ExcelInfoByInventory excelInfoByInventory = excelVos.get(i);
Map<String, Object> insert = new HashMap<>();
insert.put("mname", excelInfoByInventory.getMname());
insert.put("version",excelInfoByInventory.getVersion());
// 获取对应物料
Material materialByCode = materialService.findMaterialByCode(excelVos.get(i).getCode());
MaterialP materialByCode = materialService.findMaterialPByCondition(insert).get(0);
// 添加库存记录
Map<String, Object> insert = new HashMap<>();
Integer depositoryId = excelVos.get(i).getDepositoryId();
insert.put("mname", materialByCode.getMname());
insert.put("materialTypeId", materialByCode.getMaterialTypeId());
insert.put("state", materialByCode.getState());
insert.put("code", materialByCode.getCode());
insert.put("unit", materialByCode.getUnit());
insert.put("texture", materialByCode.getTexture());
insert.put("tempPlaceCode", excelVos.get(i).getDepositoryCode());
insert.put("quantity", String.valueOf(ObjectFormatUtil.toInteger(excelVos.get(i).getQuantity()) + materialByCode.getQuantity()));
Integer depositoryId = excelInfoByInventory.getDepositoryId();
insert.put("tempPlaceCode", excelInfoByInventory.getDepositoryCode());
insert.put("quantity", String.valueOf(ObjectFormatUtil.toInteger(excelInfoByInventory.getQuantity()) + materialByCode.getQuantity()));
// 如果模板中总金额未填写
if (excelVos.get(i).getAmounts() == null || "".equals(excelVos.get(i).getAmounts())) {
if (excelInfoByInventory.getAmounts() == null || "".equals(excelInfoByInventory.getAmounts())) {
// 求均值
// 总金额
Double amounts = Double.parseDouble(excelVos.get(i).getPrice()) * 100 * Double.parseDouble(excelVos.get(i).getQuantity());
Double amounts = Double.parseDouble(excelInfoByInventory.getPrice()) * 100 * Double.parseDouble(excelInfoByInventory.getQuantity());
insert.put("amounts", String.valueOf(materialByCode.getAmounts() + amounts));
// 保留两位
Double avgPrice = (materialByCode.getAmounts() + amounts) / (Double.parseDouble(excelVos.get(i).getQuantity()) + materialByCode.getQuantity());
Double avgPrice = (materialByCode.getAmounts() + amounts) / (Double.parseDouble(excelInfoByInventory.getQuantity()) + materialByCode.getQuantity());
BigDecimal bg = new BigDecimal(avgPrice);
avgPrice = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
insert.put("price", String.valueOf(avgPrice));
} else {
// 求均值
insert.put("amounts", String.valueOf(materialByCode.getAmounts() + Double.parseDouble(excelVos.get(i).getAmounts()) * 100));
Double avgPrice = (materialByCode.getAmounts() + Double.parseDouble(excelVos.get(i).getAmounts()) * 100) / ((Double.parseDouble(excelVos.get(i).getQuantity()) + materialByCode.getQuantity()));
insert.put("amounts", String.valueOf(materialByCode.getAmounts() + Double.parseDouble(excelInfoByInventory.getAmounts()) * 100));
Double avgPrice = (materialByCode.getAmounts() + Double.parseDouble(excelInfoByInventory.getAmounts()) * 100) / ((Double.parseDouble(excelInfoByInventory.getQuantity()) + materialByCode.getQuantity()));
// 保留两位
BigDecimal bg = new BigDecimal(avgPrice);
avgPrice = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
insert.put("price", String.valueOf(avgPrice));
}
insert.put("depositoryId", depositoryId);
insert.put("depositoryCode", excelVos.get(i).getDepositoryCode());
insert.put("depositoryCode", excelInfoByInventory.getDepositoryCode());
insert.put("mid",materialByCode.getId());
// 插入库存记录
materialService.insertMaterialForImport(insert);
materialService.insertInventoryForImport(insert);
// 将该物料同时放入默认库位中
String placeCode = excelInfoByInventories.get(i).getDepositoryCode();
@ -328,12 +340,12 @@ public class ExcelServiceImpl implements ExcelService {
// 获取默认库位
Place placeById = placeService.findPlaceById(0);
// 修改默认库位库存
placeById.setQuantity(placeById.getQuantity() + ObjectFormatUtil.toInteger(excelVos.get(i).getQuantity()));
placeById.setQuantity(placeById.getQuantity() + ObjectFormatUtil.toInteger(excelInfoByInventory.getQuantity()));
placeService.UpdatePlace(placeById);
// 添加库位与物料的映射
param.put("mid", insert.get("id"));
param.put("pid", 0);
param.put("quantity", ObjectFormatUtil.toInteger(excelVos.get(i).getQuantity()));
param.put("quantity", ObjectFormatUtil.toInteger(excelInfoByInventory.getQuantity()));
placeService.addMaterialOnPlace(param);
} else {
// 如果输入的库位不是默认库位
@ -344,18 +356,18 @@ public class ExcelServiceImpl implements ExcelService {
Place placeByCondition = placeService.findPlaceByCondition(param).get(0);
// 修改库位物料数量
placeByCondition.setQuantity(placeByCondition.getQuantity() + ObjectFormatUtil.toInteger(excelVos.get(i).getQuantity()));
placeByCondition.setQuantity(placeByCondition.getQuantity() + ObjectFormatUtil.toInteger(excelInfoByInventory.getQuantity()));
placeService.UpdatePlace(placeByCondition);
// 如果没有对应关系
param.put("pid", placeByCondition.getId());
param.put("mid", insert.get("id"));
param.put("quantity", ObjectFormatUtil.toInteger(excelVos.get(i).getQuantity()));
param.put("quantity", ObjectFormatUtil.toInteger(excelInfoByInventory.getQuantity()));
// 添加对应关系
placeService.addMaterialOnPlace(param);
}
}
success.add(excelVos.get(i));
success.add(excelInfoByInventory);
}
log.info("【批量添加】批量添加数据:{}", JSON.toJSONString(excelVos));
returnResult.put("success", success);

358
src/main/java/com/dreamchaser/depository_manage/service/impl/MaterialServiceImpl.java

@ -8,6 +8,7 @@ import com.dreamchaser.depository_manage.mapper.DepositoryMapper;
import com.dreamchaser.depository_manage.mapper.MaterialMapper;
import com.dreamchaser.depository_manage.mapper.MaterialTypeMapper;
import com.dreamchaser.depository_manage.mapper.QrCodeMapper;
import com.dreamchaser.depository_manage.pojo.InventoryP;
import com.dreamchaser.depository_manage.pojo.MaterialP;
import com.dreamchaser.depository_manage.pojo.PlaceP;
import com.dreamchaser.depository_manage.service.MaterialService;
@ -20,12 +21,9 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.*;
import java.math.BigDecimal;
import java.sql.Time;
import java.util.*;
import java.util.concurrent.*;
import java.util.logging.Level;
/**
* @author Dreamchaser
@ -76,7 +74,7 @@ public class MaterialServiceImpl implements MaterialService {
}
}
if (map.containsKey("producedDate")) {
Long producedDate = DateUtil.DateTimeByMonthToTimeStamp(map.get("producedDate").toString());
Long producedDate = DateUtil.DateTimeByDayToTimeStamp(map.get("producedDate").toString());
map.put("producedDate", producedDate);
}
String dateType = (String) map.get("dateType");
@ -159,38 +157,12 @@ public class MaterialServiceImpl implements MaterialService {
map.remove("shelfLife");
}
if (map.containsKey("producedDate")) {
Long producedDate = DateUtil.DateTimeByMonthToTimeStamp(map.get("producedDate").toString());
Long producedDate = DateUtil.DateTimeByDayToTimeStamp(map.get("producedDate").toString());
map.put("producedDate", producedDate);
}
// 开启一个线程去更新对应库存的记录
new Thread(new Runnable() {
@Override
public void run() {
HashMap<String,Object> param = new HashMap<>();
param.putAll(map);
updateInventoryInfo(param);
}
}).start();
return materialMapper.updateMaterial(map);
}
/**
* 用于修改对应的库存记录
* @param map
*/
public void updateInventoryInfo(HashMap<String,Object> map){
// 获取要修改的物料编码
HashMap<String,Object> param = new HashMap<>();
param.put("code",map.get("code"));
List<Material> inventory = materialMapper.findInventory(param);
List<Integer> list = new ArrayList<>();
for (int i = 0; i < inventory.size(); i++) {
list.add(inventory.get(i).getId());
}
map.put("list",list);
materialMapper.updateInventory(map);
}
/**
* 根据id删除一条库存记录
@ -244,7 +216,7 @@ public class MaterialServiceImpl implements MaterialService {
}
list.get(i).setPlaceCode(placeCode.toString());
}
return pack(list);
return packForMatieral(list);
}
/**
@ -254,7 +226,7 @@ public class MaterialServiceImpl implements MaterialService {
* @return 符合条件的库存信息
*/
@Override
public List<MaterialP> findInventory(Map<String, Object> map) {
public List<InventoryP> findInventory(Map<String, Object> map) {
Integer size = 10, page = 1;
if (map.containsKey("size")) {
size = ObjectFormatUtil.toInteger(map.get("size"));
@ -264,7 +236,7 @@ public class MaterialServiceImpl implements MaterialService {
page = ObjectFormatUtil.toInteger(map.get("page"));
map.put("begin", (page - 1) * size);
}
List<Material> list = materialMapper.findInventory(map);
List<Inventory> list = materialMapper.findInventory(map);
for (int i = 0; i < list.size(); i++) {
list.get(i).setPrice(list.get(i).getPrice() / 100);
list.get(i).setAmounts(list.get(i).getAmounts() / 100);
@ -287,6 +259,45 @@ public class MaterialServiceImpl implements MaterialService {
return pack(list);
}
/**
* 根据条件查询符合条件的库存
* @param map
* @return
*/
@Override
public List<MaterialP> findMaterial(Map<String, Object> map) {
Integer size = 10, page = 1;
if (map.containsKey("size")) {
size = ObjectFormatUtil.toInteger(map.get("size"));
map.put("size", size);
}
if (map.containsKey("page")) {
page = ObjectFormatUtil.toInteger(map.get("page"));
map.put("begin", (page - 1) * size);
}
List<Material> list = materialMapper.findMaterialByCondition(map);
for (int i = 0; i < list.size(); i++) {
list.get(i).setPrice(list.get(i).getPrice() / 100);
list.get(i).setAmounts(list.get(i).getAmounts() / 100);
// 获取当前物料所处仓库
Integer depositoryId = list.get(i).getDepositoryId();
// 获取当前物料所处库位
Integer mid = list.get(i).getId();
List<PlaceP> placeByMidAndDid = placeService.findPlaceByMidAndDid(mid, depositoryId);
StringBuilder placeCode = new StringBuilder();
for (int j = 0; j < placeByMidAndDid.size(); j++) {
placeCode.append(placeByMidAndDid.get(j).getCode()).append(" ");
}
if (depositoryId != null) {
Depository depositoryRecordById = depositoryMapper.findDepositoryById(depositoryId);
String code = depositoryRecordById.getCode();
list.get(i).setDepositoryCode(code);
}
list.get(i).setPlaceCode(placeCode.toString());
}
return packForMatieral(list);
}
/**
* 根据条件查询符合条件的库存总数
*
@ -352,6 +363,21 @@ public class MaterialServiceImpl implements MaterialService {
return material;
}
/**
* 根据物料id查询库存信息
* @param id 库存物料id
* @return 库存信息
*/
@Override
public Inventory findInventoryByMid(int id) {
Inventory material = materialMapper.findInventoryByMid(id);
MaterialType materialTypeByOldId = materialTypeMapper.findMaterialTypeByOldId(material.getMaterialTypeId());
material.setTypeName(materialTypeByOldId.getTname());
material.setPrice(material.getPrice() / 100);
material.setAmounts(material.getAmounts() / 100);
return material;
}
/**
* 根据id查询库存信息
*
@ -365,7 +391,7 @@ public class MaterialServiceImpl implements MaterialService {
material.setAmounts(material.getAmounts() / 100);
Long producedDate = material.getProducedDate();
if (producedDate != null) {
material.setShowProducedDate(DateUtil.TimeStampToDateTimeForMonth(producedDate));
material.setShowProducedDate(DateUtil.TimeStampToDateTimeForDay(producedDate));
}
Long life = material.getShelfLife();
if (life != null) {
@ -392,10 +418,10 @@ public class MaterialServiceImpl implements MaterialService {
* @return 库存信息
*/
@Override
public List<Material> findMaterialByIds(List<Integer> ids) {
List<Material> materialList = materialMapper.findMaterialByIds(ids);
public List<Inventory> findMaterialByIds(List<Integer> ids) {
List<Inventory> materialList = materialMapper.findInventoryByIds(ids);
for (int i = 0; i < materialList.size(); i++) {
Material material = materialList.get(i);
Inventory material = materialList.get(i);
materialList.get(i).setPrice(material.getPrice() / 100);
materialList.get(i).setAmounts(material.getAmounts() / 100);
}
@ -453,7 +479,7 @@ public class MaterialServiceImpl implements MaterialService {
@Override
public Double findAllPriceNoDelete() {
Double sum = 0.0;
List<Material> materialAll = materialMapper.findInventory(new HashMap<String, Object>());
List<Inventory> materialAll = materialMapper.findInventory(new HashMap<String, Object>());
for (int i = 0; i < materialAll.size(); i++) {
sum += materialAll.get(i).getAmounts() / 100;
}
@ -475,12 +501,74 @@ public class MaterialServiceImpl implements MaterialService {
/**
* 对查出来的记录进行包装包装成前端需要的数据
* 对查出来的库存记录进行包装包装成前端需要的数据
*
* @param list DepositoryRecord集合
* @return 包装好的集合
*/
private List<MaterialP> pack(List<Material> list) {
private List<InventoryP> pack(List<Inventory> list) {
List<InventoryP> result = new ArrayList<>(list.size());
for (Inventory inventory : list) {
InventoryP m = new InventoryP(inventory);
Integer warningCount = 0;
Integer depositoryId = inventory.getDepositoryId();
if (depositoryId != null) {
m.setDepositoryName(depositoryMapper.findDepositoryNameById(depositoryId));
m.setWarehouseManager(depositoryMapper.findUserNameByDepositoryId(depositoryId));
}
Long producedDate = inventory.getProducedDate();
if (producedDate != null) {
m.setProducedDate(DateUtil.TimeStampToDateTimeForDay(producedDate));
}
// 设置当前物料保质期的具体时间
Long calcShelfLife = Long.valueOf(0);
String currentDate = DateUtil.getCurrentDate();
// 获取当天时间
Long nowDay = DateUtil.DateTimeByDayToTimeStamp(currentDate);
Long life = inventory.getShelfLife();
if (life != null) {
String shelfLife = String.valueOf(life);
String dateType = shelfLife.substring(0, 1);
String dateTime = shelfLife.substring(1);
if ("1".equals(dateType)) {
m.setShelfLife(dateTime + "年");
calcShelfLife = ObjectFormatUtil.toLong(dateTime) * 365 * DateUtil.dayTime;
} else if ("2".equals(dateType)) {
m.setShelfLife(dateTime + "月");
calcShelfLife = ObjectFormatUtil.toLong(dateTime) * 30 * DateUtil.dayTime;
} else if ("3".equals(dateType)) {
m.setShelfLife(dateTime + "天");
calcShelfLife = ObjectFormatUtil.toLong(dateTime) * DateUtil.dayTime;
}
// 获取当前没有使用完成的物料对应的生产日期对应
List<MaterialAndProducedDate> materialAndProducedDateByMid = materialMapper.findMaterialAndProducedDateByMid(m.getId());
for (MaterialAndProducedDate materialAndProducedDate : materialAndProducedDateByMid) {
// 获取当前入库时的生产日期
Long producedDate1 = materialAndProducedDate.getProducedDate();
// 如果可使用时间(生产时间+保质期)减去当天时间 小于预警时间
if ((producedDate1 + calcShelfLife) - nowDay < DateUtil.warningTime) {
warningCount += materialAndProducedDate.getInventory();
}
}
}
MaterialType materialTypeByOldId = materialTypeMapper.findMaterialTypeByOldId(inventory.getMaterialTypeId());
m.setTypeName(materialTypeByOldId.getTname());
m.setTypeId(materialTypeByOldId.getOldId());
m.setWarningCount(warningCount);
result.add(m);
}
return result;
}
/**
* 对查出来的物料记录进行包装包装成前端需要的数据
*
* @param list Material集合
* @return 包装好的集合
*/
private List<MaterialP> packForMatieral(List<Material> list) {
List<MaterialP> result = new ArrayList<>(list.size());
for (Material material : list) {
MaterialP m = new MaterialP(material);
@ -492,14 +580,14 @@ public class MaterialServiceImpl implements MaterialService {
}
Long producedDate = material.getProducedDate();
if (producedDate != null) {
m.setProducedDate(DateUtil.TimeStampToDateTimeForMonth(producedDate));
m.setProducedDate(DateUtil.TimeStampToDateTimeForDay(producedDate));
}
// 设置当前物料保质期的具体时间
Long calcShelfLife = Long.valueOf(0);
String currentDate = DateUtil.getCurrentDate();
// 获取当天时间
Long nowDay = DateUtil.DateTimeByMonthToTimeStamp(currentDate);
Long nowDay = DateUtil.DateTimeByDayToTimeStamp(currentDate);
Long life = material.getShelfLife();
if (life != null) {
String shelfLife = String.valueOf(life);
@ -534,8 +622,6 @@ public class MaterialServiceImpl implements MaterialService {
}
return result;
}
/**
* 根据仓库查询物品
*
@ -547,8 +633,13 @@ public class MaterialServiceImpl implements MaterialService {
return materialMapper.findMaterialByDepositorys(dids);
}
/**
* 查询仓库中的物料
* @param map
* @return
*/
@Override
public List<MaterialP> findMaterialByDepository(Map<String, Object> map) {
public List<InventoryP> findInventoryByDepository(Map<String, Object> map) {
Integer size = 10, page = 1;
if (map.containsKey("size")) {
size = ObjectFormatUtil.toInteger(map.get("size"));
@ -556,7 +647,7 @@ public class MaterialServiceImpl implements MaterialService {
}
Integer depositoryId = ObjectFormatUtil.toInteger(map.get("depositoryId"));
Depository depositoryRecordById = depositoryMapper.findDepositoryById(depositoryId);
List<Material> materialByDepository = materialMapper.findMaterialByDepository(map);
List<Inventory> materialByDepository = materialMapper.findMaterialByDepository(map);
for (int i = 0; i < materialByDepository.size(); i++) {
materialByDepository.get(i).setDepositoryCode(depositoryRecordById.getCode());
// 获取当前物料所处库位
@ -567,6 +658,8 @@ public class MaterialServiceImpl implements MaterialService {
placeCode.append(placeByMidAndDid.get(j).getCode()).append(" ");
}
materialByDepository.get(i).setPlaceCode(placeCode.toString());
materialByDepository.get(i).setAmounts(materialByDepository.get(i).getAmounts()/100);
materialByDepository.get(i).setPrice(materialByDepository.get(i).getPrice()/100);
}
return pack(materialByDepository);
@ -584,7 +677,7 @@ public class MaterialServiceImpl implements MaterialService {
* @return 受影响的行数
*/
@Override
public Integer insertMaterialForImport(Map<String, Object> map) {
public Integer insertInventoryForImport(Map<String, Object> map) {
if (map.containsKey("quantity") && map.containsKey("price")) {
int quantity = (int) Math.round(Double.parseDouble(map.get("quantity").toString()));
int price = (int) (Double.parseDouble(map.get("price").toString()));
@ -592,15 +685,17 @@ public class MaterialServiceImpl implements MaterialService {
map.put("amounts", quantity * price);
}
Map<String, Object> params = new HashMap<>();
params.put("code", map.get("code"));
// params.put("code", map.get("code"));
params.put("mname",map.get("mname"));
params.put("version",map.get("version"));
params.put("depositoryId", map.get("depositoryId"));
List<Material> inventory = materialMapper.findInventory(params);
List<Inventory> inventory = materialMapper.findInventory(params);
if (inventory.size() >= 1) {
// 用于标志是新插入的物料
map.put("isNew", false);
// 如果该物料存在
Material material = inventory.get(0);
Inventory material = inventory.get(0);
Double price = (Double.parseDouble(map.get("price").toString())) / 100;
int quantity = (int) Math.round(Double.parseDouble(map.get("quantity").toString()));
// 获取当前入库金额
@ -662,11 +757,16 @@ public class MaterialServiceImpl implements MaterialService {
placeService.updateMaterialAndPlace(placeAndMaterialByMidAndPid);
}
}
return materialMapper.updateMaterial(material);
} else {
return materialMapper.updateInventory(material);
}
else {
// 用于标志是新插入的物料
map.put("isNew", true);
return materialMapper.insertMaterial(map);
Object producedDate = map.get("producedDate");
if(producedDate == null){
map.put("producedDate",0);
}
return materialMapper.insertInventory(map);
}
}
@ -721,7 +821,8 @@ public class MaterialServiceImpl implements MaterialService {
List<MaterialAndBarCode> materialByBarCodeByCondition = materialMapper.findMaterialByBarCodeByCondition(map);
if (materialByBarCodeByCondition.size() > 0) {
MaterialAndBarCode materialAndBarCode = materialByBarCodeByCondition.get(0);
materialAndBarCode.setPrice(materialAndBarCode.getPrice() / 100);
Inventory inventoryByMid = materialMapper.findInventoryByMid(materialAndBarCode.getIid());
materialAndBarCode.setPrice(inventoryByMid.getPrice() / 100);
return materialAndBarCode;
}
return null;
@ -1026,6 +1127,84 @@ public class MaterialServiceImpl implements MaterialService {
return objectList;
}
/**
* 用于修改库位中的物料
* @param map 修改条件
* @return
*/
@Transactional
@Override
public Integer editPlaceMaterial(Map<String, Object> map) {
// 获取要转移的库存信息
Integer id = ObjectFormatUtil.toInteger(map.get("mid"));
Inventory inventoryByMid = materialMapper.findInventoryByMid(id);
// 获取当前转移之前的库位
Integer fromPlaceId = ObjectFormatUtil.toInteger(map.get("fromPlaceId"));
Place fromPlace = placeService.findPlaceById(fromPlaceId);
// 获取当前转移之前的库位与库存的对应关系
MaterialAndPlace pidAndmidForBefore = placeService.findPlaceAndMaterialByMidAndPid(fromPlaceId, id);
// 获取要转移的数量
Integer quantity = ObjectFormatUtil.toInteger(map.get("quantity"));
// 获取转移到的库位
Integer toPlaceId = ObjectFormatUtil.toInteger(map.get("toPlaceId"));
Place toPlace = placeService.findPlaceById(toPlaceId);
// 获取当前转移后的库位与库存的对应关系
MaterialAndPlace pidAndmidForAfter = placeService.findPlaceAndMaterialByMidAndPid(toPlaceId, id);
// 获取转移之前的库存转移的数量
int beforeQuantity = pidAndmidForBefore.getQuantity() - quantity;
// 判断转移到的库位是否超出库存
if(toPlace.getQuantity() + quantity > toPlace.getMax()){
// 如果超出最大存储量
return -1;
}else {
// 如果没有超出最大存储量
// 判断转移到的库位是否存在该物料
if (pidAndmidForAfter != null) {
// 如果该库位有物料
// 修改转入物料数量
pidAndmidForAfter.setQuantity(pidAndmidForAfter.getQuantity() + quantity);
placeService.updateMaterialAndPlace(pidAndmidForAfter);
} else {
// 如果没有
// 新增对应关系
Map<String,Object> insertAfter = new HashMap<>();
insertAfter.put("mid",id);
insertAfter.put("quantity",quantity);
insertAfter.put("pid",toPlaceId);
// 添加对应关系
placeService.addMaterialOnPlace(insertAfter);
}
if (beforeQuantity > 0) {
// 如果转移后还存在
// 修改当前物料所在库位的数量
pidAndmidForBefore.setQuantity(beforeQuantity);
placeService.updateMaterialAndPlace(pidAndmidForBefore);
} else {
// 如果转移后不存在
// 删除该记录
placeService.deleteMaterialAndPlace(pidAndmidForBefore.getId());
}
// 修改转移之前库位的数量
fromPlace.setQuantity(fromPlace.getQuantity() - quantity);
// 修改转移之后库位的数量
toPlace.setQuantity(toPlace.getQuantity() + quantity);
placeService.UpdatePlace(fromPlace);
placeService.UpdatePlace(toPlace);
}
return 1;
}
/**
* 用于真实关闭打开的树
* @param jsonArray 传入的子列表
@ -1370,11 +1549,13 @@ public class MaterialServiceImpl implements MaterialService {
if (mt != null) {
Map<String, Object> param = new HashMap<>();
param.put("materialTypeId", mt.getOldId());
List<Material> materialPByCondition = new ArrayList<>();
// List<Material> materialByDepositorys = new ArrayList<>();
List<Inventory> materialPByCondition = new ArrayList<>();
List<Material> materialByDepositorys = new ArrayList<>();
int flag = 0;
if ("".equals(adminorg)) {
// 获取当前类别下的物料
materialPByCondition = materialMapper.findMaterialByCondition(param);
materialByDepositorys = materialMapper.findMaterialByCondition(param);
flag = 1;
} else {
// 获取当前部门管理的仓库
List<Depository> depositoryByAdminorg = depositoryMapper.findDepositoryByAdminorg(adminorg);
@ -1386,12 +1567,49 @@ public class MaterialServiceImpl implements MaterialService {
}
param.put("list", dids);
materialPByCondition = materialMapper.findMaterialByDepositorysAndType(param);
flag = 2;
}
List<Object> result = new ArrayList<>();
if(flag == 1){
if ("".equals(mname)) { // 如果没有输入名称
for (Material material : materialByDepositorys) {
Map<String, Object> map = new HashMap<>();
String version = material.getVersion();
if (version == null) {
version = "";
}
String title = material.getMname() + ",规格型号: " + version;
if (material.getDepositoryId() != null) {
// 如果当前是库存
title += ",当前库存为:" + material.getQuantity();
}
map.put("title", title);
map.put("id", material.getId());
result.add(map);
}
} else {
for (Material material : materialByDepositorys) {
Map<String, Object> map = new HashMap<>();
if (material.getMname().contains(mname)) {
String version = material.getVersion();
if (version == null) {
version = "";
}
String title = material.getMname() + ",规格型号: " + version;
if (material.getDepositoryId() != null) {
// 如果当前是库存
title += ",当前库存为:" + material.getQuantity();
}
map.put("title", title);
map.put("id", material.getId());
result.add(map);
}
}
}
}else{
if ("".equals(mname)) { // 如果没有输入名称
for (Material material : materialPByCondition) {
for (Inventory material : materialPByCondition) {
Map<String, Object> map = new HashMap<>();
String version = material.getVersion();
if (version == null) {
@ -1407,7 +1625,7 @@ public class MaterialServiceImpl implements MaterialService {
result.add(map);
}
} else {
for (Material material : materialPByCondition) {
for (Inventory material : materialPByCondition) {
Map<String, Object> map = new HashMap<>();
if (material.getMname().contains(mname)) {
String version = material.getVersion();
@ -1425,6 +1643,8 @@ public class MaterialServiceImpl implements MaterialService {
}
}
}
}
return result;
} else {
return null;
@ -1436,16 +1656,16 @@ public class MaterialServiceImpl implements MaterialService {
if (mt != null) {
Map<String, Object> param = new HashMap<>();
param.put("materialTypeId", mt.getOldId());
List<Material> materialPByCondition = new ArrayList<>();
List<Inventory> materialPByCondition = new ArrayList<>();
List<Integer> dids = new ArrayList<>();
if ("0".equals(placeId)) {
// 获取当前库位下的所有物料
dids.add(ObjectFormatUtil.toInteger(depositoryId));
param.put("list", dids);
// 获取当前类别下的物料
List<Material> materialByDepositorysAndType = materialMapper.findMaterialByDepositorysAndType(param);
List<Inventory> materialByDepositorysAndType = materialMapper.findMaterialByDepositorysAndType(param);
for (int i = 0; i < materialByDepositorysAndType.size(); i++) {
Material material = materialByDepositorysAndType.get(i);
Inventory material = materialByDepositorysAndType.get(i);
Map<String, Object> map = new HashMap<>();
MaterialAndPlace placeAndMaterialByMidAndPid = placeService.findPlaceAndMaterialByMidAndPid(0, material.getId());
if (placeAndMaterialByMidAndPid != null) {
@ -1460,9 +1680,9 @@ public class MaterialServiceImpl implements MaterialService {
// 获取当前仓库下的所有物料库存
dids.add(placeById.getDid());
param.put("list", dids);
List<Material> materialByDepositorysAndType = materialMapper.findMaterialByDepositorysAndType(param);
List<Inventory> materialByDepositorysAndType = materialMapper.findMaterialByDepositorysAndType(param);
for (int i = 0; i < materialByDepositorysAndType.size(); i++) {
Material material = materialByDepositorysAndType.get(i);
Inventory material = materialByDepositorysAndType.get(i);
Map<String, Object> map = new HashMap<>();
MaterialAndPlace placeAndMaterialByMidAndPid = placeService.findPlaceAndMaterialByMidAndPid(pid, material.getId());
if (placeAndMaterialByMidAndPid != null) {
@ -1472,7 +1692,7 @@ public class MaterialServiceImpl implements MaterialService {
}
List<Object> result = new ArrayList<>();
if ("".equals(mname)) { // 如果没有输入名称
for (Material material : materialPByCondition) {
for (Inventory material : materialPByCondition) {
Map<String, Object> map = new HashMap<>();
String version = material.getVersion();
if (version == null) {
@ -1485,7 +1705,7 @@ public class MaterialServiceImpl implements MaterialService {
result.add(map);
}
} else {
for (Material material : materialPByCondition) {
for (Inventory material : materialPByCondition) {
Map<String, Object> map = new HashMap<>();
if (material.getMname().contains(mname)) {
String version = material.getVersion();

10
src/main/java/com/dreamchaser/depository_manage/service/impl/PlaceServiceImpl.java

@ -255,6 +255,16 @@ public class PlaceServiceImpl implements PlaceService {
return placeMapper.updateMaterialAndPlace(mp);
}
/**
* 删除当前库位与物料的对应关系
* @param id 主键id
* @return
*/
@Override
public Integer deleteMaterialAndPlace(Integer id) {
return placeMapper.delMaterialOnPlace(id);
}
/**
* 获取库位对应的二维码
* @param pid

22
src/main/java/com/dreamchaser/depository_manage/service/impl/QyWxOperationService.java

@ -76,7 +76,7 @@ public class QyWxOperationService {
// 获取子订单信息
ApplicationOutRecordMin applicationOutRecordMin = applicationOutRecordMinByParent.get(i);
// 获取当前申请物料
Material materialById = materialMapper.findMaterialById(applicationOutRecordMin.getMid());
Inventory materialById = materialMapper.findInventoryByMid(applicationOutRecordMin.getMid());
// 获取当前物料所在仓库
Depository depositoryRecordById = depositoryMapper.findDepositoryById(materialById.getDepositoryId());
sumQuantity.append(applicationOutRecordMin.getQuantity()).append(",");
@ -293,7 +293,7 @@ public class QyWxOperationService {
// 获取子订单信息
StockTakingChildP childP = minRecordList.get(i);
// 获取当前申请物料
Material materialById = materialMapper.findMaterialById(childP.getMid());
Inventory materialById = materialMapper.findInventoryByMid(childP.getMid());
// 设置物料名称
mname.append(materialById.getMname()).append(",");
// 设置盘点数量
@ -543,7 +543,7 @@ public class QyWxOperationService {
// 获取子订单信息
StockTakingChildP childP = minRecordList.get(i);
// 获取当前申请物料
Material materialById = materialMapper.findMaterialById(childP.getMid());
Inventory materialById = materialMapper.findInventoryByMid(childP.getMid());
// 设置物料名称
mname.append(materialById.getMname()).append(",");
// 设置盘点数量
@ -773,7 +773,7 @@ public class QyWxOperationService {
for (ApplicationOutRecordMin recordMin : applicationOutRecordMinByParent) {
// 获取子订单信息
// 获取申请物料信息
Material materialById = materialMapper.findMaterialById(recordMin.getMid());
Inventory materialById = materialMapper.findInventoryByMid(recordMin.getMid());
// 获取仓库信息
Depository depositoryRecordById = depositoryMapper.findDepositoryById(recordMin.getDepositoryId());
// 获取处理人信息
@ -855,7 +855,7 @@ public class QyWxOperationService {
StockTakingChildP minRecord = stockTakingMapper.selectStockTakingChildPById(minId);
// 获取当前物料
Material material = materialMapper.findMaterialById(minRecord.getMid());
Inventory material = materialMapper.findInventoryByMid(minRecord.getMid());
// 设置盘点结果
String takingResult = minRecord.getTakingResult();
@ -959,7 +959,7 @@ public class QyWxOperationService {
StockTakingChildP minRecord = stockTakingMapper.selectStockTakingChildPById(minId);
// 获取当前物料
Material material = materialMapper.findMaterialById(minRecord.getMid());
Inventory material = materialMapper.findInventoryByMid(minRecord.getMid());
// 获取转移前的库位
@ -1056,7 +1056,7 @@ public class QyWxOperationService {
StockTakingChildP minRecord = stockTakingMapper.selectStockTakingChildPById(minId);
// 获取当前物料
Material material = materialMapper.findMaterialById(minRecord.getMid());
Inventory material = materialMapper.findInventoryByMid(minRecord.getMid());
// 获取转移数量
@ -1216,7 +1216,7 @@ public class QyWxOperationService {
List<TemplateCard_horizontal_content> horizontalContentList = new ArrayList<>();
// 获取申请物料信息
Material materialById = materialMapper.findMaterialById(recordMin.getMid());
Inventory materialById = materialMapper.findInventoryByMid(recordMin.getMid());
// 获取仓库信息
Depository depositoryRecordById = depositoryMapper.findDepositoryById(recordMin.getDepositoryId());
// 设至二级标题
@ -1484,7 +1484,7 @@ public class QyWxOperationService {
// 获取明细信息
ApplicationOutRecordMin recordMin = minRecordList.get(i);
// 获取当前出库物料
Material materialById = materialMapper.findMaterialById(recordMin.getMid());
Inventory materialById = materialMapper.findInventoryByMid(recordMin.getMid());
// 获取当前物料所在仓库
Depository depositoryById = depositoryMapper.findDepositoryById(recordMin.getDepositoryId());
@ -1766,7 +1766,7 @@ public class QyWxOperationService {
// 获取明细信息
ApplicationOutRecordMin recordMin = minRecordList.get(i);
// 获取当前出库物料
Material materialById = materialMapper.findMaterialById(recordMin.getMid());
Inventory materialById = materialMapper.findInventoryByMid(recordMin.getMid());
// 获取当前物料所在仓库
Depository depositoryById = depositoryMapper.findDepositoryById(recordMin.getDepositoryId());
@ -2110,7 +2110,7 @@ public class QyWxOperationService {
StockTakingChildP minRecord = minRecordList.get(i);
// 获取当前盘点物料信息
Material materialById = materialMapper.findMaterialById(minRecord.getMid());
Inventory materialById = materialMapper.findInventoryByMid(minRecord.getMid());
Map<String,Object> detail_list = new HashMap<>();

16
src/main/java/com/dreamchaser/depository_manage/service/impl/StockTakingServiceImpl.java

@ -105,7 +105,7 @@ public class StockTakingServiceImpl implements StockTakingService {
List barCodeList = (ArrayList) barCodeListByNoMaterial.get("barCode" + temp);
Map<String, Object> param = new HashMap<>();
param.put("list", barCodeList);
Material materialById = materialMapper.findMaterialById(mid);
Inventory materialById = materialMapper.findInventoryByMid(mid);
param.put("code", materialById.getCode());
materialMapper.addBarCodeAndMaterialForMoreOne(param);
}
@ -113,7 +113,7 @@ public class StockTakingServiceImpl implements StockTakingService {
if(map.containsKey("producedDate")){
String producedDate = (String) map.get("producedDate");
if(!"".equals(producedDate)){
map.put("producedDate",DateUtil.DateTimeByMonthToTimeStamp(producedDate));
map.put("producedDate",DateUtil.DateTimeByDayToTimeStamp(producedDate));
}else{
map.remove("producedDate");
}
@ -603,7 +603,7 @@ public class StockTakingServiceImpl implements StockTakingService {
Integer inventory = minRecord.getInventory();
// 获取盘点物料信息
Material materialById = materialMapper.findMaterialById(minRecord.getMid());
Inventory materialById = materialMapper.findInventoryByMid(minRecord.getMid());
Map<String, Object> paramForMaterialAndPlace = new HashMap<>();
@ -760,7 +760,7 @@ public class StockTakingServiceImpl implements StockTakingService {
// 更新当前物料信息
materialMapper.updateMaterial(materialById);
materialMapper.updateInventory(materialById);
minIds.add(minRecord.getId());
@ -880,7 +880,7 @@ public class StockTakingServiceImpl implements StockTakingService {
Integer inventory = minRecord.getInventory();
Material materialById = materialMapper.findMaterialById(minRecord.getMid());
Inventory materialById = materialMapper.findInventoryByMid(minRecord.getMid());
Map<String, Object> paramForMaterialAndPlace = new HashMap<>();
paramForMaterialAndPlace.put("mid", materialById.getId());
@ -1070,7 +1070,7 @@ public class StockTakingServiceImpl implements StockTakingService {
// 更新当前物料信息
materialMapper.updateMaterial(materialById);
materialMapper.updateInventory(materialById);
minIds.add(minRecord.getId());
}
@ -1427,10 +1427,10 @@ public class StockTakingServiceImpl implements StockTakingService {
paramForMaterialToDepository.put("code", material.getCode());
// 获取转移后的仓库中的该物料
List<Material> materialByDepository = materialMapper.findInventory(paramForMaterialToDepository);
List<Inventory> materialByDepository = materialMapper.findInventory(paramForMaterialToDepository);
if (materialByDepository.size() > 0) {
// 如果转移后的仓库中存在该物料
Material transferMaterial = materialByDepository.get(0);
Inventory transferMaterial = materialByDepository.get(0);
//获取物料与转移后库位的对应关系
Map<String, Object> paramForMaterialAndPlace = new HashMap<>();

27
src/main/java/com/dreamchaser/depository_manage/utils/DateUtil.java

@ -83,7 +83,7 @@ public class DateUtil {
// 将日期转为时间戳
public static Long DateTimeByMonthToTimeStamp(String dateTime){
public static Long DateTimeByDayToTimeStamp(String dateTime){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date date = null;
try {
@ -95,14 +95,37 @@ public class DateUtil {
return ts;
}
// 将日期转为时间戳
public static Long DateTimeByMonthToTimeStamp(String dateTime){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
Date date = null;
try {
date = simpleDateFormat.parse(dateTime);
} catch (ParseException e) {
throw new RuntimeException(e);
}
long ts = date.getTime();
return ts;
}
// 将时间戳转为日期
public static String TimeStampToDateTimeForMonth(Long timeStamp){
public static String TimeStampToDateTimeForDay(Long timeStamp){
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
long lt = new Long(timeStamp);
Date date = new Date(lt);
res = simpleDateFormat.format(date);
return res;
}
// 将时间戳转为日期
public static String TimeStampToDateTimeForMonth(Long timeStamp){
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
long lt = new Long(timeStamp);
Date date = new Date(lt);
res = simpleDateFormat.format(date);
return res;
}

6
src/main/resources/application-test.yml

@ -79,9 +79,9 @@ mybatis:
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
log-prefix: mapper.
#mybatis-plus:
# configuration:
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
file:
uploadPath: D:/upLoad

1
src/main/resources/static/js/lay-config.js

@ -9,6 +9,7 @@ window.rootPath = (function (src) {
src = document.scripts[document.scripts.length - 1].src;
return src.substring(0, src.lastIndexOf("/") + 1);
})();
// alert(rootPath)
layui.config({
base: rootPath + "lay-module/",
version: true

18
src/main/resources/templates/index_mobile.html

@ -30,6 +30,24 @@
<script src="../static/js/vue/vue-router.js"></script>
<script src="../static/lib/http-vue-loader/src/httpVueLoader.js"></script>
<style id="layuimini-bg-color">
.layui-header{
height: 35px !important;
}
.layui-nav {
height: 35px !important;
}
.layui-nav-item {
color: #1b1d21;
height: 35px !important;
line-height: 35px !important;
}
.layui-layout-admin .layui-body{
top: 35px !important;
}
</style>
</head>
<body class="layui-layout-body layuimini-all">

84
src/main/resources/templates/pages/application/application-in.html

@ -33,10 +33,12 @@
width: 100%;
border-style: none;
}
.lay-step{
.lay-step {
display: none;
}
.layui-form-select .layui-input{
.layui-form-select .layui-input {
border-style: none;
}
@ -81,7 +83,8 @@
onblur="selectCode(this)"
class="layui-input" lay-verify="required"
style="border-style: none">
<img src="/static/images/search.ico" height="16" width="16" id="qrCodeImg"
<img src="/static/images/search.ico" height="16" width="16"
id="qrCodeImg"
style="margin-top: 10px" onclick="scanCodeInStorage(this)">
<input id="qrCode" name="qrCode" type="text" style="display:none;">
</div>
@ -104,7 +107,8 @@
<div class="layui-form-item" style="display: none" id="producedDateItem">
<label class="layui-form-label">生产日期:</label>
<div class="layui-input-block">
<input type="text" name="producedDate" id="producedDate" placeholder="请填写生产日期" onclick="selectDate(this)"
<input type="text" name="producedDate" id="producedDate"
placeholder="请填写生产日期" onclick="selectDate(this)"
autocomplete="off" class="layui-input">
</div>
</div>
@ -126,7 +130,8 @@
<label class="layui-form-label">仓库:</label>
<div class="layui-input-block">
<div class="inputdiv">
<input type="text" placeholder="请选择仓库" class="layui-input" style="border-style: none"
<input type="text" placeholder="请选择仓库" class="layui-input"
style="border-style: none"
id="openSonByDepository" readonly
onclick="openDepositoryTree(this)"
lay-verify="required"/>
@ -184,7 +189,7 @@
</div>
</div>
</div>
</div>
</div>
</div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
@ -239,7 +244,7 @@
let scanValue = {};
// 用于卡片编号
var NewIdNumber = 1;
layui.use(['form', 'step', 'flow','laydate'], function () {
layui.use(['form', 'step', 'flow', 'laydate'], function () {
var $ = layui.$,
form = layui.form,
laydate = layui.laydate,
@ -259,8 +264,6 @@
});
// 用于提交操作
form.on('submit(formStep)', function (data) {
data = data.field;
@ -360,8 +363,8 @@
<div class="inputdiv">
<input id="code" name=` + "code" + NewIdNumber + ` type="text" placeholder="请填写入物料编码" value="" onblur="selectCode(this)"
class="layui-input" lay-verify="required" style="border-style: none">
<img id=`+"qrCodeImg"+NewIdNumber+` src="/static/images/search.ico" height="16" width="16" style="margin-top: 10px" onclick="scanCodeInStorage(this)" >
<input id=`+"qrCode"+NewIdNumber +` name=`+"qrCode"+NewIdNumber+` type="text" style="display:none;">
<img id=` + "qrCodeImg" + NewIdNumber + ` src="/static/images/search.ico" height="16" width="16" style="margin-top: 10px" onclick="scanCodeInStorage(this)" >
<input id=` + "qrCode" + NewIdNumber + ` name=` + "qrCode" + NewIdNumber + ` type="text" style="display:none;">
</div>
</div>
</div>
@ -377,10 +380,10 @@
</div>
</div>
</div>
<div class="layui-form-item" style="display: none" id=` +"producedDateItem"+NewIdNumber + `>
<div class="layui-form-item" style="display: none" id=` + "producedDateItem" + NewIdNumber + `>
<label class="layui-form-label">生产日期:</label>
<div class="layui-input-block">
<input type="text" name=`+"producedDate"+NewIdNumber +` id=`+"producedDate"+NewIdNumber+` placeholder="请填写生产日期"
<input type="text" name=` + "producedDate" + NewIdNumber + ` id=` + "producedDate" + NewIdNumber + ` placeholder="请填写生产日期"
onclick="selectDate(this)" autocomplete="off" class="layui-input">
</div>
</div>
@ -459,17 +462,16 @@
}
// 用于选择生产日期
selectDate = function(obj) {
selectDate = function (obj) {
var name = obj.id;
laydate.render({
elem: '#'+name
elem: '#' + name
, format: 'yyyy-MM-dd'
, show: true
});
};
// 用于实现通过编码查询物料
selectCode = function (obj) {
// 输入code
@ -511,7 +513,7 @@
} else {
materialName.value = d.mname;
materialId.value = d.id;
materialId.value = d.mid;
priceValue.value = d.price;
// 获取物料与条形码的对应关系
var materialAndBarCodeList = d["materialAndBarCodeList"];
@ -537,8 +539,7 @@
$("#barCode" + idNumber).append(new Option(item.bmcode, item.bmcode));//往下拉菜单里添加元素
});
form.render();
}
else{
} else {
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
@ -548,7 +549,7 @@
if (shelfLife !== null && shelfLife !== undefined) {
$("#" + "producedDateItem" + idNumber).show();
$("#" + "producedDate" + idNumber).attr("lay-verify", "required");
}else{
} else {
$("#" + "producedDateItem" + idNumber).hide();
}
}
@ -588,12 +589,12 @@
content: '/getMaterialAll?mname=' + mname + '&type=1&clickObj=' + parentId,
move: '.layui-layer-title',
fixed: false,
success: function(layero, index){
success: function (layero, index) {
var children = layero.children();
var content = $(children[1]);
var iframeChildren = $(content.children());
content.css('height','100%');
iframeChildren.css('height','100%');
content.css('height', '100%');
iframeChildren.css('height', '100%');
},
end: function () {
var mid = materialId.value;
@ -634,8 +635,7 @@
if (shelfLife !== null && shelfLife !== undefined) {
$("#" + "producedDateItem" + idNumber).show();
$("#" + "producedDate" + idNumber).attr("lay-verify", "required");
}
else{
} else {
$("#" + "producedDateItem" + idNumber).hide();
form.render();
}
@ -681,14 +681,13 @@
} else {
var material = d.data[0];
materialName.value = material.mname;
materialId.value = material.id;
materialId.value = material.mid;
codeValue.value = material.code;
var shelfLife = material.shelfLife;
if (shelfLife !== null && shelfLife !== undefined) {
$("#" + "producedDateItem" + idNumber).show();
$("#" + "producedDate" + idNumber).attr("lay-verify", "required");
}
else{
} else {
$("#" + "producedDateItem" + idNumber).hide();
form.render();
}
@ -708,7 +707,7 @@
var result = res.resultStr;//当needResult为1时返回处理结果
var req = {};
req.qrCode = result;
$("#qrCode"+objIdNumber).val(result);
$("#qrCode" + objIdNumber).val(result);
$.ajax({
url: "/material/qywxApplicationInScanQrCode",
type: "post",
@ -738,8 +737,16 @@
if (code === undefined) {
code = "";
}
if (data === null) {
// 如果没有对应关系
layer.msg("对于编码:" + result + ",并未发现对应的物料", {
icon: 0,
time: 1000 //0.5秒关闭(如果不配置,默认是3秒)
}, function () {
})
} else {
materialName.value = data.mname;
materialId.value = data.id;
materialId.value = data.mid;
codeValue.value = code;
priceValue.value = data.price;
var materialAndBarCodeList = data["materialAndBarCodeList"];
@ -771,13 +778,14 @@
if (shelfLife !== null && shelfLife !== undefined) {
$("#" + "producedDateItem" + idNumber).show();
$("#" + "producedDate" + idNumber).attr("lay-verify", "required");
}
else{
} else {
$("#" + "producedDateItem" + idNumber).hide();
form.render();
}
}
}
})
}
})
@ -878,12 +886,12 @@
move: '.layui-layer-title',
fixed: false,
content: '/selectDepositoryByCard?type=1&clickObj=' + parentId,
success: function(layero, index){
success: function (layero, index) {
var children = layero.children();
var content = $(children[1]);
var iframeChildren = $(content.children());
content.css('height','100%');
iframeChildren.css('height','100%');
content.css('height', '100%');
iframeChildren.css('height', '100%');
}
});
};
@ -913,17 +921,17 @@
var depositoryName = parent.childNodes[1];
var depositoryId = parent.childNodes[3];
var placeId = parent.childNodes[5];
if(flag === 0){
if (flag === 0) {
// 如果没有获取到位置
layer.msg("当前二维码错误,请重新扫描");
}else if(flag === 1){
} else if (flag === 1) {
// 如果获取到的是库位
var place = data["place"];
placeId.value = place.id;
depositoryId.value = place.did;
depositoryName.value = place.depositoryName;
}else if(flag === 2){
} else if (flag === 2) {
// 如果获取到的是仓库
var depository = data["depository"];
placeId.value = "0";

2
src/main/resources/templates/pages/application/application-in_back.html

@ -50,7 +50,7 @@
lay-verify="required"/>
<i class="layui-icon layui-icon-search" style="display: inline" id="selectMaterial"></i>
</div>
<input type="text" th:value="${materialById.getId()}" name="mid" class="layui-input" id="mid"
<input type="text" th:value="${materialById.getMid()}" name="mid" class="layui-input" id="mid"
style="display: none" lay-verify="required" />
</div>

27
src/main/resources/templates/pages/application/application-out.html

@ -388,7 +388,7 @@
<div class="inputdiv">
<input id="code" name=` + "code" + NewIdNumber + ` type="text" placeholder="请填写入物料编码" onblur="selectCode(this)"
class="layui-input" lay-verify="required" value="${obj.code}" style="border-style: none">
<img src="/static/images/search.ico" height="16" width="16" style="margin-top: 10px" onclick="scanCodeInStorage(this)" >
<img src="/static/images/search.ico" height="16" width="16" style="margin-top: 10px" onclick="scanCodeByOut(this)" >
</div>
</div>
</div>
@ -691,7 +691,7 @@
var data = d.data;
if (data !== null) {
materialName.value = data.mname;
materialId.value = data.mid;
materialId.value = data.id;
materialCode.value = data.mcode;
var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
barCodeInput.value = result;
@ -713,7 +713,6 @@
// 用于扫码功能
scanCodeByOut = function (obj) {
parent.wx.scanQRCode({
desc: 'scanQRCode desc',
needResult: 1, // 默认为0,扫描结果由企业微信处理,1则直接返回扫描结果,
@ -745,7 +744,7 @@
// 物料编码
var materialCodeItem = parent.childNodes[7].childNodes[3].childNodes[1].childNodes;
var materialCode = materialCodeItem.childNodes[1];
var materialCode = materialCodeItem[1];
var idNumber = materialId.name.split("mid")[1];
// 获取物料与条形码的对应关系
@ -802,7 +801,7 @@
let val = $("#quantity" + id).val();
if (val !== null && val !== undefined && val !== '') {
var req = {};
req.code = mcode;
req.mcode = mcode;
req.quantity = val;
$.ajax({
url: "/material/MaterialQuantityIsTrue",
@ -815,24 +814,6 @@
if (!flag) { // 如果当前数目不合适
layer.msg("当前物料数量不足", {icon: 0, time: 500}, function () {
$("#quantity" + id).val("");
// 获取对应元素
var parent = obj.parentNode.parentNode.parentNode;
var children = parent.childNodes[5];
var codeChildren = parent.childNodes[7];
var materialItem = children.childNodes[3].childNodes[1].childNodes;
var materialName = materialItem[1];
var materialId = materialName.parentNode.parentNode.childNodes[3];
var codeItem = codeChildren.childNodes[3].childNodes[1].childNodes;
var codeValue = codeItem[1];
materialName.value = "";
materialId.value = "";
codeValue.value = "";
var idNumber = materialId.name.split("mid")[1];
$("#barCode" + idNumber).empty();
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
}
});
}

41
src/main/resources/templates/pages/application/application-out_back.html

@ -25,9 +25,7 @@
.lay-step{
display: none;
}
.layui-form-select .layui-input{
border-style: none;
}
</style>
<div class="layuimini-container">
<div class="layuimini-main">
@ -67,7 +65,7 @@
<div class="layui-form-item">
<label class="layui-form-label">物料数量:</label>
<div class="layui-input-block">
<input name="quantity" type="number" placeholder="请填写入物料数量" value="" class="layui-input" lay-verify="number" required>
<input name="quantity" id="quantity" onblur="MaterialQuantityIsTrue(this)" type="number" placeholder="请填写入物料数量" value="" class="layui-input" lay-verify="number" required>
</div>
</div>
<div class="layui-form-item">
@ -116,6 +114,7 @@
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
function MaterialQuantityIsTrue(){}
layui.use([ 'form', 'step','layer','jquery'], function () {
var $ = layui.$,
form = layui.form,
@ -334,6 +333,40 @@
step.next('#stepForm');
});
//用于判断当前物料数量是否合适
MaterialQuantityIsTrue = function (obj) {
var id = obj.id.split("quantity")[1];
var mcode = $("#code" + id).val(); // 获取到当前输入的物料编码
if (mcode === "" || mcode === undefined || mcode === null) {
layer.msg("请输入物料的正确编码!", {icon: 0, time: 500}, function () {
$("#quantity" + id).val("")
});
} else {
let val = $("#quantity" + id).val();
if (val !== null && val !== undefined && val !== '') {
var req = {};
req.mcode = mcode;
req.quantity = val;
$.ajax({
url: "/material/MaterialQuantityIsTrue",
type: "post",
data: JSON.stringify(req),
dataType: 'json',
contentType: "application/json;charset=utf-8",
success: function (res) {
var flag = res.data;
if (!flag) { // 如果当前数目不合适
layer.msg("当前物料数量不足", {icon: 0, time: 500}, function () {
$("#quantity" + id).val("");
});
}
}
});
}
}
}
})
</script>
</body>

4
src/main/resources/templates/pages/application/application-out_min.html

@ -68,7 +68,6 @@
cols: [
[
{title: '操作', width: 100, toolbar: '#currentTableBar', align: "center"},
{field: 'id', width: 100, title: '提交编号', sort: true},
{field: 'code', width: 200, title: '提交编码', sort: true},
{field: 'mname', width: 120, title: '物料名称'},
{field: 'mcode', width: 120, title: '物料编码'},
@ -84,12 +83,11 @@
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line',
done: function (res, curr, count) {
$("[data-field='id']").css('display', 'none');
var data = res.data;
if (data.length > 0) {
if (data[0].state === "进行中") {

50
src/main/resources/templates/pages/application/application-transfer.html

@ -95,7 +95,7 @@
<div class="layui-form-item">
<label class="layui-form-label">物料数量:</label>
<div class="layui-input-block">
<input name="quantity" type="number" placeholder="请填写入物料数量" value="" class="layui-input" lay-verify="number" required>
<input id="quantity" name="quantity" type="number" onblur="MaterialQuantityIsTrue(this)" placeholder="请填写入物料数量" value="" class="layui-input" lay-verify="number" required>
</div>
</div>
<div class="layui-form-item">
@ -179,6 +179,11 @@
}
// 用于判断数量是否合适
function MaterialQuantityIsTrue() {
}
// 用于扫描位置
function scanLocationByQrCode() {
@ -331,7 +336,7 @@
<div class="layui-form-item">
<label class="layui-form-label">物料数量:</label>
<div class="layui-input-block">
<input name=`+"quantity"+NewIdNumber+` type="number" placeholder="请填写入物料数量" value=""
<input name=`+"quantity"+NewIdNumber+` id=`+"quantity"+NewIdNumber+` type="number" placeholder="请填写入物料数量" value="" onblur="MaterialQuantityIsTrue(this)"
class="layui-input" lay-verify="number">
</div>
</div>
@ -435,12 +440,16 @@
$('#place' + codeId).append(new Option(item.depositoryName + "-" + item.code, item.id));//往下拉菜单里添加元素
});
form.render();
}// 如果没有对应关系
}
else{
// 如果没有对应关系
layer.msg("对于编码:" + result + ",并未发现对应的物料", {
icon: 0,
time: 1000 //0.5秒关闭(如果不配置,默认是3秒)
}, function () {
})
}
}
});
@ -821,6 +830,41 @@
})
}
//用于判断当前物料数量是否合适
MaterialQuantityIsTrue = function (obj) {
var id = obj.id.split("quantity")[1];
console.log(id)
var mcode = $("#code" + id).val(); // 获取到当前输入的物料编码
if (mcode === "" || mcode === undefined || mcode === null) {
layer.msg("请输入物料的正确编码!", {icon: 0, time: 500}, function () {
$("#quantity" + id).val("")
});
} else {
let val = $("#quantity" + id).val();
if (val !== null && val !== undefined && val !== '') {
var req = {};
req.mcode = mcode;
req.quantity = val;
$.ajax({
url: "/material/MaterialQuantityIsTrue",
type: "post",
data: JSON.stringify(req),
dataType: 'json',
contentType: "application/json;charset=utf-8",
success: function (res) {
var flag = res.data;
if (!flag) { // 如果当前数目不合适
layer.msg("当前物料数量不足", {icon: 0, time: 500}, function () {
$("#quantity" + id).val("");
});
}
}
});
}
}
}
})
</script>

4
src/main/resources/templates/pages/application/application_multi.html

@ -76,7 +76,7 @@
{title: '操作', minWidth: 250, toolbar: '#currentTableBar', align: "center"}
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line',
@ -109,8 +109,10 @@
req.applyRemarks = [];
req.prices = [];
req.placeCodes = [];
req.iids = [];
for (i = 0, len = data.length; i < len; i++) {
req.mids[i] = data[i].mid;
req.iids[i] = data[i].iid;
req.depositoryIds[i] = data[i].depositoryId;
req.quantitys[i] = data[i].quantity;
req.applyRemarks[i] = data[i].applyRemark;

2
src/main/resources/templates/pages/chart/chart-out_back.html

@ -293,7 +293,7 @@
legend: {},
tooltip: {
trigger: 'axis',
showContent: false
showContent: true
},
dataset: {
source: []

3
src/main/resources/templates/pages/chart/chart-stock_back.html

@ -221,7 +221,7 @@
legend: {},
tooltip: {
trigger: 'axis',
showContent: false
showContent: true
},
dataset: {
source: []
@ -389,7 +389,6 @@
echartsRecords.setOption(optionRecords);
echartsPies.setOption(optionPies);
echartsDataset.setOption(optionDataset);
console.log(optionDataset)
echartsMap.setOption(optionMap);
}
}

4
src/main/resources/templates/pages/company/company-out.html

@ -100,7 +100,6 @@
cols: [
[
{type: "checkbox", width: 50},
{field: 'id', width: 100, title: 'id', sort: true},
{field: 'number', width: 100, title: '编号', sort: true},
{field: 'name', width: 250, title: '名称'},
{field: 'abbreviation', width: 200, title: '简称'},
@ -116,12 +115,11 @@
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line',
done: function () {
$("[data-field='id']").css('display', 'none');
}
});

3
src/main/resources/templates/pages/company/company-out_back.html

@ -112,14 +112,13 @@
cols: [
[
{type: "checkbox", width: 50},
{field: 'cid', width: 100, title: '公司', sort: true},
{field: 'cname', width: 120, title: '公司名称', sort: true},
{field: 'introduce', width: 200, title: '公司介绍', sort: true},
{field: 'state', title: '状态', minWidth: 80, templet: '#switchTpl'},
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line'

4
src/main/resources/templates/pages/company/companyByParentId.html

@ -101,7 +101,6 @@
cols: [
[
{type: "checkbox", width: 50},
{field: 'id', width: 100, title: 'id', sort: true},
{field: 'number', width: 100, title: '编号', sort: true},
{field: 'name', width: 200, title: '名称', sort: true},
{field: 'abbreviation', width: 200, title: '简称', sort: true},
@ -117,12 +116,11 @@
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line',
done: function () {
$("[data-field='id']").css('display', 'none');
}
});

4
src/main/resources/templates/pages/depository/table-in.html

@ -139,7 +139,6 @@
cols: [
[
{type: "checkbox", width: 50},
{field: 'id', width: 200, title: '提交编号', sort: true},
{field: 'aircode', width: 150, title: '提交编码', sort: true},
{field: 'mname', width: 150, title: '物料名称'},
{field: 'mcode', width: 150, title: '存货编码'},
@ -152,12 +151,11 @@
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line',
done: function () {
$("[data-field='id']").css('display', 'none');
}
});

4
src/main/resources/templates/pages/depository/table-out.html

@ -171,7 +171,6 @@
cols: [
[
{type: "checkbox", width: 50},
{field: 'id', width: 150, title: '申请编号', sort: true},
{field: 'code', width: 150, title: '申请编码', sort: true},
{field: 'mname', width: 150, title: '物料名称'},
{field: 'mcode', width: 150, title: '存货编码'},
@ -202,12 +201,11 @@
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line',
done: function () {
$("[data-field='id']").css('display', 'none');
}
});

79
src/main/resources/templates/pages/depository/table-stock.html

@ -68,17 +68,26 @@
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-subclass" lay-event="applicationIn">入库申请</a>
<a class="layui-btn layui-btn-xs data-count-edit" lay-event="applicationOut">出库申请</a>
</script>
<script id="selectManager" type="text/html">
</script>
</div>
</div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
var data;
function changePlaceCode(){}
layui.use(['form', 'table', 'upload'], function () {
var $ = layui.jquery,
form = layui.form,
upload = layui.upload,
table = layui.table;
$('#openSonByDepository').on('click', function () {
layer.open({
type: 2,
@ -126,7 +135,6 @@
cols: [
[
{type: "checkbox", width: 50},
{field: 'id', width: '50px', title: '物料编号'},
{field: 'mname', width: 200, title: '物料名称'},
{field: 'version', width: 200, title: '规格型号'},
{field: 'code', width: 200, title: '存货编码'},
@ -134,7 +142,7 @@
{field: 'quantity', width: 200, title: '数量', sort: true},
{field: 'depositoryName', width: 200, title: '仓库名称'},
{field: 'depositoryCode', width: 200, title: '仓库编码'},
{field: 'placeCode', width: 200, title: '库位编码'},
{title: '所处库位', width: 200, templet: '#selectManager', align: "center"},
{field: 'warningCount', width: 200, title: '待过期数量', sort: true},
{field: 'price', title: '单价', width: 200, sort: true},
{field: 'amounts', title: '总金额', width: 200, sort: true},
@ -143,15 +151,17 @@
{title: '操作', minWidth: 250, toolbar: '#currentTableBar', align: "center"}
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line',
done: function (res, curr, count) {
$("[data-field='id']").css('display', 'none');
$("[data-field='shelfLifeForCalc']").css('display', 'none');
$.each(res['data'], function (i, j) {
let jElement = j['warningCount'];
let placeCode = j['placeCode'].split(" ");
let depositoryId = j['depositoryId'];
let mid = j['id'];
if (jElement !== null && jElement !== undefined) {
let flag = (Number(jElement) !== 0);
if (flag) {
@ -160,7 +170,17 @@
}
}
//
var placeCodeItem = $("[lay-id='currentTableId'] tr:eq(" + (i+1) + ")").children()[8];
var aItem = placeCodeItem.childNodes[0];
for (let k = 0; k < placeCode.length; k++) {
if(placeCode[k] !== ""){
$(aItem).append('<button id='+mid+' class="layui-btn layui-btn-primary layui-btn-xs" onclick="changePlaceCode(this)" value='+depositoryId+'>'+placeCode[k]+'</button>')
}
}
});
}
});
// 用于给table行上色的方法
@ -185,6 +205,14 @@
console.log(obj)
});
// 用于进行渲染库位编码
form.on('switch(createPlaceCode)', function (obj) {
console.log(obj)
});
// 监听库位修改操作
// 监听搜索操作
form.on('submit(data-search-btn)', function (data) {
var req = {};
@ -196,7 +224,7 @@
req.depositoryId = data.depositoryId;
}
if (data.code !== '') {
req.code = data.code;
req.mcode = data.code;
}
//执行搜索重载
table.reload('currentTableId', {
@ -266,7 +294,8 @@
layer.msg("未选中记录,请确认!");
return false;
}
} else if (obj.event === 'dispose') {
}
else if (obj.event === 'dispose') {
var index = layer.open({
title: '入库申请',
type: 2,
@ -300,7 +329,8 @@
layer.full(index);
});
return false;
} else if (obj.event === 'applicationOut') {
}
else if (obj.event === 'applicationOut') {
// 出库申请
var index = layer.open({
title: '出库申请',
@ -315,10 +345,43 @@
layer.full(index);
});
return false;
}
});
changePlaceCode = function (obj) {
var depositoryId = obj.value;
var placeCode = obj.innerText;
var mid = obj.id;
var index = layer.open({
title: '选择库位',
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: true,
area: ['70%', '70%'],
content: '/selectPlaceByDepository?depositoryId=' + depositoryId+'&mid='+mid+'&placeCode='+placeCode,
success: function(layero, index){
var children = layero.children();
var content = $(children[1]);
var iframeChildren = $(content.children());
content.css('height','100%');
iframeChildren.css('height','100%');
},
end:function () {
//执行搜索重载
table.reload('currentTableId', {
url: '/material/findInventory',
page: {
curr: 1
}
, where: {}
}, 'data');
}
});
$(window).on("resize", function () {
layer.full(index);
});
};
//用于导入数据
var upLoader = upload.render({

4
src/main/resources/templates/pages/material/material-out.html

@ -167,7 +167,6 @@
[
{type: "checkbox", width: 50},
{field: 'code', width: 150, title: '存货编码', sort: true},
{field: 'id', width: 100, title: 'EAS编号', hidden: true},
{field: 'mname', width: 120, title: '物料名称', sort: false},
{field: 'typeName', width: 150, title: '物料种类'},
{field: 'version', width: 200, title: '规格型号', sort: false},
@ -181,12 +180,11 @@
{title: '操作', minWidth: 200, toolbar: '#currentTableBar', align: "center"}
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line',
done: function () {
$("[data-field='id']").css('display', 'none');
}
});

4
src/main/resources/templates/pages/material/material-out_back.html

@ -190,7 +190,6 @@
[
{type: "checkbox", width: 50},
{field: 'code', width: 150, title: '存货编码', sort: true},
{field: 'id', width: 100, title: 'EAS编号', hidden: true},
{field: 'mname', width: 120, title: '物料名称', sort: false},
{field: 'typeName', width: 150, title: '物料种类'},
{field: 'version', width: 200, title: '规格型号', sort: false},
@ -206,12 +205,11 @@
{title: '操作', minWidth: 200, toolbar: '#currentTableBar', align: "center"}
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line',
done: function () {
$("[data-field='id']").css('display', 'none');
}
});

127
src/main/resources/templates/pages/material/selectPlaceByDepository.html

@ -0,0 +1,127 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>layui</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
<link rel="stylesheet" href="/static/css/public.css" media="all">
</head>
<body>
<input id="depositoryId" name="depositoryId" th:value="${depositoryId}" style="display: none">
<input id="quantity" name="quantity" th:value="${quantity}" style="display: none">
<input id="placeId" name="placeId" th:value="${placeId}" style="display: none">
<input id="mid" name="mid" th:value="${mid}" style="display: none">
<div id="test2" class="demo-tree"></div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
layui.use(['form', 'layer','dropdown','tree'], function () {
var $ = layui.jquery,
tree = layui.tree;
var depositoryId = $("#depositoryId").val();
var quantity = $("#quantity").val();
var fromPlaceId = $("#placeId").val();
var mid = $("#mid").val();
test = tree.render({
elem: '#test2'
,data: []
,onlyIconControl: true //是否仅允许节点左侧图标控制展开收缩
,click: function(obj){
var data = obj.data;
if(data.id === -1 ){
return false;
}
// 判断点击的是仓库还是库位
// 用于判断是库位还是仓库
var flag = false;
var dataId = data.id;
let placeId = 0;
if(typeof dataId === "string"){
flag = true;
}
if(!flag) {
placeId = 0;
}else{
var did = dataId.split("-");
placeId = did[1];
}
// 弹出输入框用于输入转移数量
outQuantityCheck(placeId)
}
});
$.ajax({
url: "/repository/treeMenus_Place?depositoryId="+depositoryId,
type: 'get',
dataType: 'json',
contentType: "application/json;charset=utf-8",
beforeSend: function () {
},
success: function (d) {
let data2 = d.data;
test.reload({
data:data2
});
},
});
outQuantityCheck = function (placeId) {
console.log(quantity)
layer.prompt({
formType: 0,
value: quantity,
title: '请输入转移数量',
}, function (value, index, elem) {
if (value > quantity) {
layer.msg("非法值,重新输入!", {
icon: 0,
time: 500
},
function () {
// 修改数量为当前数
$(elem).val(quantity)
})
} else {
// 修改当前物料所在库位
var req = {};
req.quantity = value;
req.mid = mid;
req.fromPlaceId = fromPlaceId;
req.toPlaceId = placeId;
$.ajax({
url:"/material/editPlaceMaterial",
type: 'post',
dataType: 'json',
contentType: "application/json;charset=utf-8",
data: JSON.stringify(req),
success:function (data) {
if(data.status === 205){
layer.msg("修改成功",{
icon:1,
time:1000
},function () {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
})
}else{
layer.msg(data.statusInfo.detail,{
icon:5,
time:1000
},function () {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
})
}
}
})
}
});
}
})
</script>
</body>
</html>

4
src/main/resources/templates/pages/materialBarCode/materialBarCode_out.html

@ -80,7 +80,6 @@
cols: [
[
{type: "checkbox", width: 50},
{field: 'id', width: 50, title: 'id'},
{field: 'mcode', width: 150, title: '存货编码', sort: true},
{field: 'bmcode', width: 150, title: '条形码', sort: true},
{field: 'mname', width: 120, title: '物料名称', sort: false},
@ -90,12 +89,11 @@
{title: '操作', minWidth: 200, toolbar: '#currentTableBar', align: "center"}
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line',
done: function () {
$("[data-field='id']").css('display', 'none');
}
});

3
src/main/resources/templates/pages/materialtype/materialTypeByParentId.html

@ -103,7 +103,6 @@
cols: [
[
{type: "checkbox", width: 50},
{field: 'id', width: 100, title: '类型编号', sort: true},
{field: 'tname', width: 120, title: '类型名称', sort: true},
{field: 'introduce', width: 200, title: '类型介绍', sort: true},
{
@ -118,7 +117,7 @@
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line'

6
src/main/resources/templates/pages/materialtype/materialType_view.html

@ -118,21 +118,17 @@
cols: [
[
{type: "checkbox", width: 50},
{field: 'id', width: 100, title: 'id', sort: true},
{field: 'oldId', width: 100, title: '类型编号', sort: true},
{field: 'tname', width: 120, title: '类型名称'},
{field: 'introduce', width: 200, title: '类型介绍'},
{field: 'state', title: '状态', minWidth: 80, templet: '#switchTpl'},
{title: '操作', minWidth: 200, toolbar: '#currentTableBar', align: "center"}
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line',
done: function () {
$("[data-field='id']").css('display', 'none');
$("[data-field='oldId']").css('display', 'none');
}
});

6
src/main/resources/templates/pages/post/post-out.html

@ -98,14 +98,12 @@
cols: [
[
{type: "checkbox", width: 50},
{field: 'id', width: 100, title: 'id', sort: true},
{field: 'number', width: 100, title: '编号', sort: true},
{field: 'name', width: 250, title: '名称'},
{field: 'dutiesname', width: 200, title: '名称'},
{field: 'aoname', width: 200, title: '归属行政组织名称'},
{field: 'aonumber', width: 200, title: '归属行政组织编号'},
{field: 'jobname', width: 200, title: '职务类别'},
{field: 'rolename', width: 200, title: '权限名称'},
{field: 'depositoryName', width: 200, title: '管理仓库'},
{field: 'superiorname', width: 200, title: '上级名称'},
{field: 'superiornumber', width: 200, title: '上级编号'},
@ -122,13 +120,11 @@
{title: '操作', minWidth: 250, toolbar: '#currentTableBar', align: "center"}
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line',
done: function () {
$("[data-field='id']").css('display', 'none');
$("[data-field='rolename']").css('display', 'none');
}
});

44
src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut.html

@ -24,6 +24,7 @@
<input id="mcode" style="display: none" th:value="${materialById.getCode()}">
<input id="depositoryId" style="display: none" th:value="${record.getDepositoryId()}">
<input id="quantity" style="display: none" th:value="${record.getQuantity() - record.getTrueOut()}">
<input id="flagForSelect" style="display: none" value="false">
<div style="width: 500px" id="reader">
</div>
@ -34,6 +35,8 @@
let mcode = layui.$("#mcode").val();
let depositoryId = layui.$("#depositoryId").val();
let quantity = layui.$("#quantity").val();
// 用于标志选择时是否成功
let flagForSelect = layui.$("#flagForSelect").val();
// 先定义,用于弹出确定框
function isOutTrue() {
@ -295,7 +298,7 @@
outboundLogic(req)
}
})
}, function () { // 取消
}, function () { // 选择
// 进行选择对应物料
layer.open({
title: '物料列表',
@ -304,8 +307,10 @@
maxmin: true,
shadeClose: true,
area: ['50%', '50%'],
content: '/ScanBarOrQrCodeOut_selectMaterial?pid=' + place.id+'&mcode='+mcode,
content: '/ScanBarOrQrCodeOut_selectMaterial?pid=' + place.id+'&mcode='+mcode+'&depositoryId='+place.did,
end: function () {
let flagForSelect = layui.$("#flagForSelect").val();
if(flagForSelect){
var param = {};
param.id = id;
param.placeId = place.id;
@ -314,6 +319,7 @@
// 弹出确定框
outQuantityCheck(param);
}
}
})
/*var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);*/
@ -361,7 +367,7 @@
if (material == null) {
// 如果还没有扫描物料
layer.confirm("请扫描物料", {
btn: ["扫描", "取消"]
btn: ["扫描", "选择"]
}, function () { // 继续
layer.close(layer.index); // 关闭弹窗
parent.parent.parent.wx.scanQRCode({
@ -379,10 +385,32 @@
});
}, function () { // 取消
// 关闭当前页
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}, function () { // 选择
// 进行选择对应物料
layer.open({
title: '物料列表',
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: true,
area: ['50%', '50%'],
content: '/ScanBarOrQrCodeOut_selectMaterial?pid=' + 0+'&mcode='+mcode+'&depositoryId='+depository.id,
end: function () {
let flagForSelect = layui.$("#flagForSelect").val();
if(flagForSelect){
var param = {};
param.id = id;
param.qrCode = qrCode;
param.barCode = barCode;
// 弹出确定框
outQuantityCheck(param);
}
}
})
/*var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);*/
})
} else {
// 如果已经扫描物料
@ -426,7 +454,7 @@
time: 500
},
function () {
outQuantityCheck(req);
layui.$(elem).val(quantity)
})
} else {
req.trueOut = value;

2
src/main/resources/templates/pages/scanQrCode/ScanBarOrQrCodeOut_selectMaterial.html

@ -33,7 +33,6 @@
// 获取当前点击物料编码
var code = this.value;
// 获取当前点击物料名称
var mname = this.innerText;
if(code !== mcode){
// 如果点击的不是要出库的物料
layer.msg("请选择正确物料",{
@ -43,6 +42,7 @@
})
}else{
$("#flagForSelect",window.parent.document).val(true);
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}

4
src/main/resources/templates/pages/stockTaking/stockTaking.html

@ -50,7 +50,7 @@
<div class="layui-fluid">
<div class="layui-card">
<form class="layui-form"
style="margin: 0 auto;max-width: 700px;padding-bottom: 200px"
style="margin: 0 auto;max-width: 700px;"
lay-filter="form1" id="form1">
<div class="layui-card-body" id="takingHeader" style="padding-right: 0px">
<div class="layui-form-item">
@ -331,7 +331,7 @@
elem: '#stepForm',
filter: 'stepForm',
width: '100%', //设置容器宽度
height: '1350px',
height: '900px',
stepItems: [{
title: '填写信息'
}, {

4
src/main/resources/templates/pages/user/table-user.html

@ -112,7 +112,6 @@
cols: [
[
{type: "checkbox", width: 50},
{field: 'id', width: 80, title: 'ID', sort: true},
{field: 'number', width: 100, title: '工号', sort: true},
{field: 'name', width: 100, title: '姓名'},
{
@ -157,7 +156,6 @@
}
}
},
{field: 'rolename', width: 200, title: '权限名称'},
{field: 'depositoryName', width: 200, title: '管理仓库'},
{field: 'mobilephone', width: 200, title: '内线电话'},
{field: 'companyname', width: 200, title: '公司名称'},
@ -173,8 +171,6 @@
page: true,
skin: 'line',
done: function () {
$("[data-field='id']").css('display', 'none');
$("[data-field='rolename']").css('display', 'none');
}
});

4
src/main/resources/templates/pages/warehouse/depository-out.html

@ -121,7 +121,6 @@
cols: [
[
{type: "checkbox", width: 50},
{field: 'id', width: 100, title: '仓库编号', sort: true},
{field: 'code', width: 150, title: '仓库编码'},
{field: 'dname', width: 120, title: '仓库名称'},
{field: 'cname', width: 200, title: '所处公司'},
@ -135,12 +134,11 @@
{title: '操作', minWidth: 250, toolbar: '#currentTableBar', align: "center"}
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line',
done: function () {
$("[data-field='id']").css('display', 'none');
}
});

2
src/main/resources/templates/pages/warehouse/warehouseByParentId.html

@ -133,7 +133,7 @@
{title: '操作', minWidth: 150, toolbar: '#currentTableBar', align: "center"}
]
],
limits: [10, 15, 20, 25, 50],
limits: [10, 15, 20, 25, 50,100],
limit: 10,
page: true,
skin: 'line',

22
src/test/java/com/dreamchaser/depository_manage/TestForThisWeekInventory.java

@ -61,10 +61,10 @@ public class TestForThisWeekInventory {
Iterator it = depositoryAllNameAndId.keySet().iterator();
// 获取日期
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
Long now = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()));
Long now = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()));
instance.add(Calendar.DATE, 1);
// 明天
Long tomorrow = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()));
Long tomorrow = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()));
// 仓库名称列表
List<String> depositoryName = new ArrayList<>();
// 各仓库对应入库数目
@ -73,7 +73,7 @@ public class TestForThisWeekInventory {
// 各仓库当前库存数目
Map<String, Object> todayInventory = new HashMap<>();
instance.add(Calendar.DATE, -2);
Long yesterday = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()));
Long yesterday = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()));
while (it.hasNext()) {
// 遍历 Map并计算各仓库的入库数
Object key = it.next();
@ -126,12 +126,12 @@ public class TestForThisWeekInventory {
} else {
int now = instance.get(Calendar.DAY_OF_WEEK) - 1 == 0 ? 7 : instance.get(Calendar.DAY_OF_WEEK) - 1;
List<Long> days = new ArrayList<>();
days.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())));
Boolean flag = false;
while (now - 1 > 0) {
now--;
instance.add(Calendar.DATE, -1);
long format = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()));
long format = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()));
days.add(format);
}
while (it.hasNext()) {
@ -146,9 +146,9 @@ public class TestForThisWeekInventory {
// 判断当天是否有出入口记录
Calendar IsInOut = Calendar.getInstance();
Long start = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(IsInOut.getTime()));
Long start = DateUtil.DateTimeByDayToTimeStamp(formatter.format(IsInOut.getTime()));
IsInOut.add(Calendar.DATE, 1);
Long end = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(IsInOut.getTime()));
Long end = DateUtil.DateTimeByDayToTimeStamp(formatter.format(IsInOut.getTime()));
// 判断今天是否有出入库记录
Integer inCount = depositoryRecordService.findApplicationInRecordByDate(end, start, null);
Integer OutCount = depositoryRecordService.findApplicationOutRecordByDate(end, start, null);
@ -207,13 +207,13 @@ public class TestForThisWeekInventory {
instance.set(Calendar.MONTH, month);
instance.set(Calendar.DAY_OF_MONTH, 1);
source.put("month", month + "月");
months.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
months.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())));
month--;
sourceList.add(((HashMap<String, Object>) source).clone());
}
instance.set(Calendar.MONTH, month);
instance.set(Calendar.DAY_OF_MONTH, 1);
months.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
months.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())));
Map<String, Object> map = new HashMap<>();
map.put("months", months);
map.put("sourceList", sourceList);
@ -247,10 +247,10 @@ public class TestForThisWeekInventory {
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK) - 1;
int offset1 = 1 - dayOfWeek;
calendar.add(Calendar.DATE, offset1 - 7);
lastTime.add(DateUtil.DateTimeByMonthToTimeStamp(sdf.format(calendar.getTime())));
lastTime.add(DateUtil.DateTimeByDayToTimeStamp(sdf.format(calendar.getTime())));
for (int i = 0; i < 7; i++) {
calendar.add(Calendar.DATE, 1);
lastTime.add(DateUtil.DateTimeByMonthToTimeStamp(sdf.format(calendar.getTime())));
lastTime.add(DateUtil.DateTimeByDayToTimeStamp(sdf.format(calendar.getTime())));
}
return lastTime;
}

8
src/test/java/com/dreamchaser/depository_manage/TestForgetMapData.java

@ -45,9 +45,9 @@ public class TestForgetMapData {
Calendar instance = Calendar.getInstance();
// 获取日期
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
Long now = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()));
Long now = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()));
instance.add(Calendar.DATE, 1);
Long tomorrow = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()));
Long tomorrow = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()));
instance.add(Calendar.DATE, -2);
String yesterday = formatter.format(instance.getTime());
while (it.hasNext()) {
@ -158,13 +158,13 @@ public class TestForgetMapData {
instance.set(Calendar.MONTH, month);
instance.set(Calendar.DAY_OF_MONTH, 1);
source.put("month", month + "月");
months.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
months.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())));
month--;
sourceList.add(((HashMap<String, Object>) source).clone());
}
instance.set(Calendar.MONTH, month);
instance.set(Calendar.DAY_OF_MONTH, 1);
months.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
months.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())));
Map<String, Object> map = new HashMap<>();
map.put("months", months);
map.put("sourceList", sourceList);

11
src/test/java/com/dreamchaser/depository_manage/TestForgetShowData.java

@ -1,7 +1,6 @@
package com.dreamchaser.depository_manage;
import com.alibaba.fastjson.JSONObject;
import com.dreamchaser.depository_manage.controller.DepositoryController;
import com.dreamchaser.depository_manage.entity.MaterialType;
import com.dreamchaser.depository_manage.entity.UserByPort;
import com.dreamchaser.depository_manage.mapper.DepositoryMapper;
@ -78,13 +77,13 @@ public class TestForgetShowData {
int now = instance.get(Calendar.DAY_OF_WEEK) - 1 == 0 ? 7 : instance.get(Calendar.DAY_OF_WEEK) - 1;
List<Long> days = new ArrayList<>(); // 周一至今的每天
instance.add(Calendar.DATE, 1);
days.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())));
instance.add(Calendar.DATE, -1);
days.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())));
while (now - 1 > 0) {
now--;
instance.add(Calendar.DATE, -1);
Long format = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()));
Long format = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()));
days.add(format);
}
@ -287,13 +286,13 @@ public class TestForgetShowData {
instance.set(Calendar.MONTH, month);
instance.set(Calendar.DAY_OF_MONTH, 1);
source.put("month", month + "月");
months.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
months.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())));
month--;
sourceList.add(((HashMap<String, Object>) source).clone());
}
instance.set(Calendar.MONTH, month);
instance.set(Calendar.DAY_OF_MONTH, 1);
months.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
months.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())));
Map<String, Object> map = new HashMap<>();
map.put("months", months);
map.put("sourceList", sourceList);

16
src/test/java/com/dreamchaser/depository_manage/TestForgetSourceList.java

@ -1,6 +1,5 @@
package com.dreamchaser.depository_manage;
import com.dreamchaser.depository_manage.controller.DepositoryController;
import com.dreamchaser.depository_manage.entity.MaterialType;
import com.dreamchaser.depository_manage.mapper.MaterialTypeMapper;
import com.dreamchaser.depository_manage.service.DepositoryRecordService;
@ -13,7 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.swing.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.*;
@ -37,10 +36,6 @@ public class TestForgetSourceList {
@Test
public void Test(){
// List<Object> sourceList = getSourceList("1");
// System.out.println(sourceList);
MaterialType materialTypeByOldId = materialTypeMapper.findMaterialTypeByOldId(Long.valueOf("25"));
System.out.println(findChildForMaterialTypeByParent(materialTypeByOldId));
}
@ -188,15 +183,16 @@ public class TestForgetSourceList {
*/
public static Map<String, Object> getPreviousMonth() {
Calendar instance = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
Map<String, Object> source = new HashMap<>();
List<Object> sourceList = new ArrayList<>();
int month = instance.get(Calendar.MONTH) + 1;
ArrayList<Object> months = new ArrayList<>();
while (month > 0) {
instance.set(Calendar.MONTH, month);
instance.set(Calendar.DAY_OF_MONTH, 1);
instance.set(Calendar.DAY_OF_MONTH, -1);
source.put("month", month + "月");
System.out.println(formatter.format(instance.getTime()));;
months.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())));
month--;
sourceList.add(((HashMap<String, Object>) source).clone());
@ -209,5 +205,9 @@ public class TestForgetSourceList {
map.put("sourceList", sourceList);
return map;
}
}

4
target/classes/META-INF/MANIFEST.MF

@ -1,4 +0,0 @@
Manifest-Version: 1.0
Main-Class: com.dreamchaser.depository_manage.DepositoryManageApplicatio
n

17
target/classes/META-INF/spring-configuration-metadata.json

@ -1,17 +0,0 @@
{
"groups": [
{
"name": "file",
"type": "com.dreamchaser.depository_manage.config.FileConfig",
"sourceType": "com.dreamchaser.depository_manage.config.FileConfig"
}
],
"properties": [
{
"name": "file.upload-path",
"type": "java.lang.String",
"sourceType": "com.dreamchaser.depository_manage.config.FileConfig"
}
],
"hints": []
}

87
target/classes/application-test.yml

@ -1,87 +0,0 @@
#开启健康检查、审计、统计和监控,即可通过访问/actuator/beans等查看状态
management:
endpoints:
web:
exposure:
include: beans,health
spring:
mobile:
sitepreference:
enabled:true
servlet:
multipart:
enabled: true
max-file-size: 100MB # 单个文件上传的最大上限
max-request-size: 100MB # 一次请求总大小上限
##数据库设置
datasource:
username: root
password: root
url: jdbc:mysql://localhost:3306/depository?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf8
driver-class-name: com.mysql.cj.jdbc.Driver
type: com.alibaba.druid.pool.DruidDataSource
initialSize: 5
minIdle: 5
maxActive: 10
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1 FROM DUAL
useGlobalDataSourceStat: true
server:
port: 9090
testWhileIdle: true
testOnReturn: false
testOnBorrow: false
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
#配置监控统计拦截的filters,去掉后监控界面sql将无法统计,'wall'用于防火墙
filters: stat, wall, log4j
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
#超时回收机制
removeAbandoned: true
removeAbandonedTimeout: 1800
logAbandoned: true
banner:
location: banner.txt
thymeleaf:
cache: false
mode: HTML
mvc:
hiddenmethod:
filter:
enabled: true
view:
prefix: /templates/
suffix: .html
static-path-pattern: /static/**
redis:
port: 6379
host: 127.0.0.1
database: 0
jedis:
pool:
min-idle: 10
max-idle: 20
max-wait: -1ms
max-active: 200
timeout: 2000ms
server:
mybatis:
type-aliases-package: com.dreamchaser.depository_manage.entity
configuration:
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
log-prefix: mapper.
#mybatis-plus:
# configuration:
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
file:
uploadPath: D:/upLoad

5
target/classes/application.yml

@ -1,5 +0,0 @@
spring:
profiles:
active: test
server:
port: 11111

14
target/classes/banner.txt

@ -1,14 +0,0 @@
,---, ____ ,---,
.' .' `\ ,' , `. ,--.' |
,---.' \ __ ,-. ,-+-,.' _ | | | : __ ,-.
| | .`\ |,' ,'/ /| ,-+-. ; , || : : : .--.--. ,' ,'/ /|
: : | ' |' | |' | ,---. ,--.--. ,--.'|' | || ,---. : | |,--. ,--.--. / / ' ,---. ' | |' |
| ' ' ; :| | ,'/ \ / \ | | ,', | |,/ \ | : ' | / \ | : /`./ / \ | | ,'
' | ; . |' : / / / | .--. .-. | | | / | |--'/ / ' | | /' :.--. .-. | | : ;_ / / |' : /
| | : | '| | ' . ' / | \__\/: . . | : | | , . ' / ' : | | | \__\/: . . \ \ `. . ' / || | '
' : | / ; ; : | ' ; /| ," .--.; | | : | |/ ' ; :__ | | ' | : ," .--.; | `----. \' ; /|; : |
| | '` ,/ | , ; ' | / | / / ,. | | | |`-' ' | '.'|| : :_:,'/ / ,. | / /`--' /' | / || , ;
; : .' ---' | : |; : .' \| ;/ | : :| | ,' ; : .' \'--'. / | : | ---'
| ,.' \ \ / | , .-./'---' \ \ / `--'' | , .-./ `--'---' \ \ /
'---' `----' `--`---' `----' `--`---' `----'

108
target/classes/com/dreamchaser/depository_manage/mapper/AccesstoAddressMapper.xml

@ -1,108 +0,0 @@
<?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">
<!-- depository -->
<mapper namespace="com.dreamchaser.depository_manage.mapper.AccesstoAddressMapper">
<!-- This code was generated by TableGo tools, mark 1 begin. -->
<!-- 字段映射 -->
<resultMap id="accesstoAddress" type="com.dreamchaser.depository_manage.entity.AccesstoAddress">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="url" property="url" jdbcType="VARCHAR" />
<result column="type" property="type" jdbcType="INTEGER" />
<result column="role_id" property="role_id" jdbcType="INTEGER" />
<result column="menuparent" property="menuparent" jdbcType="INTEGER" />
<result column="state" property="state" jdbcType="INTEGER" />
<result column="icon" property="icon" jdbcType="VARCHAR"/>
<result column="target" property="target" jdbcType="VARCHAR"/>
<result column="ischild" property="ischild" jdbcType="INTEGER"/>
</resultMap>
<!-- This code was generated by TableGo tools, mark 1 end. -->
<!-- This code was generated by TableGo tools, mark 2 begin. -->
<!-- 表查询字段 -->
<sql id="allColumns">
a.id,a.name,a.url ,a.`type` ,a.role_id ,a.menuparent ,a.state,a.icon,a.target,a.ischild
</sql>
<select id="findAllMenus" resultMap="accesstoAddress">
select
<include refid="allColumns"></include>
from accesstoaddress a
where a.state != 3
</select>
<select id="findAccessstoAddressByParentAndRole" resultMap="accesstoAddress" parameterType="map">
select
<include refid="allColumns"/>
from accesstoaddress a
where 1 = 1
<if test="roleId != null and roleId != ''">
and a.role_id = #{roleId}
</if>
<if test="menuparent != null and menuparent != ''">
and a.menuparent = #{menuparent}
</if>
and a.state != 3
</select>
<select id="findMenusByRole" resultMap="accesstoAddress" parameterType="map">
select
<include refid="allColumns"/>
from accesstoaddress a
where 1 = 1
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="roleId != null and roleId != ''">
and a.role_id = #{roleId}
</if>
<if test="menuparent != null and menuparent != ''">
and a.menuparent = #{menuparent}
</if>
and a.state != 3
</select>
<select id="findMenusByNoParent" resultMap="accesstoAddress">
select
<include refid="allColumns"></include>
from accesstoaddress a
where 1 = 1
and a.menuparent = 0
</select>
<select id="findAccessstoAddressByParent" resultMap="accesstoAddress" parameterType="INTEGER">
select
<include refid="allColumns"></include>
from accesstoaddress a
where 1 = 1
and a.menuparent = #{id}
</select>
<select id="findAccessToAddressByUser" resultMap="accesstoAddress" parameterType="map">
select
<include refid="allColumns"/>
from
AccessToAddressByUser a
where authority = #{roleId}
<if test="userId != '' and userId != null ">
and uid = #{userId}
</if>
<if test="menuparent != null and menuparent != ''">
and menuparent = #{menuparent}
</if>
</select>
<select id="findAccessToAddressByList" resultMap="accesstoAddress" parameterType="list">
select
<include refid="allColumns"/>
from accesstoaddress a
where a.id in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>

35
target/classes/com/dreamchaser/depository_manage/mapper/CallBackLogMapper.xml

@ -1,35 +0,0 @@
<?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">
<!-- depository -->
<mapper namespace="com.dreamchaser.depository_manage.mapper.CallBackLogMapper">
<resultMap id="callBackMap" type="com.dreamchaser.depository_manage.entity.CallBackLog">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="msg_signature" property="msg_signature" jdbcType="VARCHAR" />
<result column="timestamp" property="timestamp" jdbcType="INTEGER" />
<result column="nonce" property="nonce" jdbcType="VARCHAR" />
<result column="echostr" property="echostr" jdbcType="VARCHAR" />
<result column="xmlstr" property="xmlstr" jdbcType="VARCHAR" />
<result column="jsonstr" property="jsonstr" jdbcType="VARCHAR" />
<result column="reqdata" property="reqdata" jdbcType="VARCHAR"/>
<result column="addtime" property="addtime" jdbcType="INTEGER"/>
</resultMap>
<insert id="addCallBackLog">
INSERT INTO callback_log (
id, msg_signature, timestamp,nonce,echostr,xmlstr,jsonstr,reqdata,addtime
) VALUES (
#{id},
#{msg_signature},
#{timestamp},
#{nonce},
#{echostr},
#{xmlstr},
#{jsonstr},
#{reqdata},
#{addtime}
)
</insert>
</mapper>

168
target/classes/com/dreamchaser/depository_manage/mapper/CompanyMapper.xml

@ -1,168 +0,0 @@
<?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">
<!-- depository -->
<mapper namespace="com.dreamchaser.depository_manage.mapper.CompanyMapper">
<!-- This code was generated by TableGo tools, mark 1 begin. -->
<!-- 字段映射 -->
<resultMap id="companyMap" type="com.dreamchaser.depository_manage.entity.Company">
<id column="cid" property="cid" jdbcType="INTEGER" />
<result column="cname" property="cname" jdbcType="VARCHAR" />
<result column="state" property="state" jdbcType="INTEGER"/>
<result column="parentId" property="parentId" jdbcType="INTEGER"/>
<result column="introduce" property="introduce" jdbcType="VARCHAR"/>
</resultMap>
<!-- This code was generated by TableGo tools, mark 1 end. -->
<!-- This code was generated by TableGo tools, mark 2 begin. -->
<!-- 表查询字段 -->
<sql id="allColumns">
c.cid, c.cname ,c.state , c.parentId,c.introduce
</sql>
<!-- 查询所有数据 -->
<select id="findCompanyAll" resultMap="companyMap">
SELECT
<include refid="allColumns" />
FROM company c
Where c.state != 3
</select>
<select id="findcompanyById" resultMap="companyMap" parameterType="int">
select <include refid="allColumns"/>
from company c
where c.cid = #{id}
</select>
<!-- 根据条件查询公司-->
<select id="findCompanyByCondition" resultMap="companyMap" parameterType="map">
select
<include refid="allColumns"/>
from company c
where 1 = 1
<if test="id != null and id !=''">
and c.cid = #{id}
</if>
<if test="cname != null and cname != ''">
and c.cname LIKE CONCAT('%', #{cname}, '%')
</if>
<if test="introduce != null and introduce !=''">
and c.introduce LIKE CONCAT('%', #{introduce}, '%')
</if>
<if test="parentId != null">
AND c.parentId = #{parentId}
</if>
<if test="state != null">
and c.state = #{state}
</if>
and c.state != 3
</select>
<!-- 根据条件参数查询数据列表数目 -->
<select id="findCountByCondition" resultType="int" parameterType="map">
SELECT count(*)
from company c
where 1 = 1
<if test="id != null and id !=''">
and c.cid = #{id}
</if>
<if test="cname != null and cname != ''">
and c.cname LIKE CONCAT('%', #{cname}, '%')
</if>
<if test="introduce != null and introduce !=''">
and c.introduce LIKE CONCAT('%', #{introduce}, '%')
</if>
<if test="parentId != null">
AND c.parentId = #{parentId}
</if>
and c.state != 3
</select>
<!--根据父级查询公司信息-->
<select id="findCompanyByParentId" resultMap="companyMap" parameterType="int">
select
<include refid="allColumns"/>
from company c
where c.state != 3 and c.parentId = #{parentId}
</select>
<!-- 根据主键删除数据 -->
<delete id="deleteCompanyById" parameterType="int">
DELETE FROM company WHERE cid = #{id}
</delete>
<!-- 根据主键批量删除数据 -->
<delete id="deleteCompanyByIds" parameterType="list">
DELETE FROM company WHERE cid IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 修改数据 -->
<update id="updateCompany" parameterType="map">
UPDATE company
<set>
<if test="cname != null">
cname = #{cname},
</if>
<if test="introduce != null">
introduce = #{introduce},
</if>
<if test="state != null">
state = #{state},
</if>
<if test="parentId != null">
parentId = #{parentId}
</if>
</set>
WHERE cid = #{id}
</update>
<!--插入数据-->
<insert id="insertCompany" parameterType="map">
INSERT INTO company (
cid, cname, introduce,parentId
) VALUES (
#{id},
#{cname},
#{introduce},
#{parentId}
)
</insert>
<!-- 根据主键将状态改为删除-->
<update id="changeStateToDeletedById" parameterType="int">
update company
<set>
state = 3
</set>
where cid = #{id}
</update>
<!-- 根据主键批量将状态改为删除-->
<update id="changeStateToDeletedByIds" parameterType="list">
update company
<set>
state = 3
</set>
where cid in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="updateStateByParam" parameterType="map">
update company
<set>
state = #{state}
</set>
where cid = #{cid}
<if test="oldState != null">
and state = #{oldState}
</if>
and state != 3
</update>
</mapper>

364
target/classes/com/dreamchaser/depository_manage/mapper/DepositoryMapper.xml

@ -1,364 +0,0 @@
<?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">
<!-- depository -->
<mapper namespace="com.dreamchaser.depository_manage.mapper.DepositoryMapper">
<!-- This code was generated by TableGo tools, mark 1 begin. -->
<!-- 字段映射 -->
<resultMap id="depositoryMap" type="com.dreamchaser.depository_manage.entity.Depository">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="dname" property="dname" jdbcType="VARCHAR" />
<result column="address" property="address" jdbcType="VARCHAR" />
<result column="introduce" property="introduce" jdbcType="VARCHAR" />
<result column="parentId" property="parentId" jdbcType="INTEGER"/>
<result column="cid" property="cid" jdbcType="INTEGER"/>
<result column="code" property="code" jdbcType="VARCHAR"/>
<result column="adminorg" property="adminorg" jdbcType="VARCHAR"/>
<result column="minNumber" property="minNumber" jdbcType="INTEGER"/>
<result column="maxNumber" property="maxNumber" jdbcType="INTEGER"/>
</resultMap>
<resultMap id="inventoryByDname" type="com.dreamchaser.depository_manage.pojo.InventoryByDname">
<result column="inventory" property="inventory" jdbcType="INTEGER"/>
<result column="dname" property="dname" jdbcType="VARCHAR"/>
</resultMap>
<!-- This code was generated by TableGo tools, mark 1 end. -->
<!-- This code was generated by TableGo tools, mark 2 begin. -->
<!-- 表查询字段 -->
<sql id="allColumns">
d.id, d.dname, d.address, d.introduce,d.state,d.parentId,d.cid,d.code,d.adminorg,d.maxNumber,d.minNumber
</sql>
<!-- 视图查询字段-->
<sql id="depositoryAndCompany">
id,dname,address,introduce,state,parentId,cid,cname,code,adminorg,minNumber,maxNumber
</sql>
<!-- This code was generated by TableGo tools, mark 2 end. -->
<!-- 根据id获取仓库名称 -->
<select id="findDepositoryNameById" resultType="string" parameterType="int">
SELECT
d.dname
FROM depository d where d.id=#{id}
</select>
<!-- &lt;!&ndash; 查询所有数据 &ndash;&gt;
<select id="findDepositoryAll" resultMap="depositoryMap">
SELECT
<include refid="allColumns" />
FROM depository d
Where d.state != 3
</select>-->
<!-- 查询所有数据 -->
<select id="findDepositoryAll" resultMap="depositoryMap">
SELECT
<include refid="depositoryAndCompany" />
FROM depositoryandcompany dc
Where dc.state != 3
</select>
<!-- 获取当前部门仓库以及公共仓库-->
<select id="findDepositoryByAdminorg" resultMap="depositoryMap" parameterType="string">
SELECT
<include refid="allColumns" />
FROM depository d WHERE 1 = 1 and d.state != 3
<if test="adminorg != null and adminorg != ''">
and d.adminorg = #{adminorg}
</if>
or d.adminorg = ''
</select>
<!-- 根据仓库编码获取仓库-->
<select id="findDepositoryByCode" resultMap="depositoryMap" parameterType="string">
SELECT
<include refid="allColumns" />
FROM depository d WHERE 1 = 1 and d.state != 3
<if test="depositoryCode != null and depositoryCode !=''">
and d.code = #{depositoryCode}
</if>
</select>
<select id="findDepositoryByAdminorgAndParent" resultMap="depositoryMap" parameterType="map">
SELECT
<include refid="allColumns" />
FROM depository d WHERE 1 = 1
<if test="adminorg != null and adminorg != ''">
and (d.adminorg = #{adminorg} or d.adminorg = 361)
</if>
<if test="parentId != null">
AND d.parentId = #{parentId}
</if>
or d.adminorg = '' and d.state != 3
</select>
<!-- 根据主键查询多个数据-->
<select id="selectDepositoryByIds" parameterType="list" resultMap="depositoryMap">
select
<include refid="allColumns"></include>
FROM depository d WHERE d.id IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<!-- 根据条件查询数据列表 -->
<select id="findDepositoryByCondition" resultMap="depositoryMap" parameterType="map">
SELECT
<include refid="allColumns" />
FROM depository d WHERE 1 = 1
<if test="depositoryId != null">
AND d.id = #{depositoryId}
</if>
<if test="dname != null and dname != ''">
AND d.dname LIKE CONCAT('%', #{dname}, '%')
</if>
<if test="address != null and address != ''">
AND d.address LIKE CONCAT('%', #{address}, '%')
</if>
<if test="introduce != null and introduce != ''">
AND d.introduce LIKE CONCAT('%', #{introduce}, '%')
</if>
<if test="state != null and state != '' ">
AND d.state = #{state}
</if>
<if test="parentId != null">
AND d.parentId = #{parentId}
</if>
<if test="cid != null">
and d.cid = #{cid}
</if>
<if test="adminorg != null">
and (d.adminorg = #{adminorg} or d.adminorg = '')
</if>
AND d.state != 3
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
</select>
<!-- 根据条件参数查询数据列表数目 -->
<select id="findCountByCondition" resultType="int" parameterType="map">
SELECT count(*)
FROM depository d WHERE 1 = 1
<if test="dname != null and dname != ''">
AND d.dname LIKE CONCAT('%', #{dname}, '%')
</if>
<if test="address != null and address != ''">
AND d.address LIKE CONCAT('%', #{address}, '%')
</if>
<if test="introduce != null and introduce != ''">
AND d.introduce LIKE CONCAT('%', #{introduce}, '%')
</if>
<if test="state != null and state != '' ">
AND d.state = #{state}
</if>
<if test="parentId != null">
AND d.parentId = #{parentId}
</if>
<if test="cid != null">
and d.cid = #{cid}
</if>
<if test="adminorg != null">
and d.adminorg = #{adminorg}
</if>
AND d.state != 3
</select>
<select id="getParentByDepository" resultMap="depositoryMap" parameterType="int">
SELECT
<include refid="allColumns" />
FROM depository d WHERE d.parentId = #{parentId}
</select>
<!-- 根据主键查询数据-->
<select id="findDepositoryById" resultMap="depositoryMap" parameterType="Integer">
SELECT
<include refid="allColumns" />
FROM depository d WHERE d.id = #{id}
</select>
<!-- 插入数据 -->
<insert id="insertDepository" parameterType="map">
INSERT INTO depository (
id, dname, address, introduce,parentId,cid,code,adminorg,maxNumber,minNumber
) VALUES (
#{id},
#{dname},
#{address},
#{introduce},
#{parentId},
#{cid},
#{code},
#{adminorg},
#{maxNumber},
#{minNumber}
)
</insert>
<!-- 批量插入数据
<insert id="insertDepositorys" parameterType="list">
INSERT INTO depository (
id, dname, address, introduce
) VALUES
<foreach collection="list" index="index" item="item" separator=",">
(
#{item.id},
#{item.dname},
#{item.address},
#{item.introduce}
)
</foreach>
</insert>
-->
<!-- 修改数据 -->
<update id="updateDepository" parameterType="map">
UPDATE depository
<set>
<if test="dname != null">
dname = #{dname},
</if>
<if test="address != null">
address = #{address},
</if>
<if test="introduce != null">
introduce = #{introduce},
</if>
<if test="state != null">
state = #{state},
</if>
<if test="parentId != null">
parentId = #{parentId},
</if>
<if test="cid != null">
cid = #{cid},
</if>
<if test="adminorg != null">
adminorg = #{adminorg},
</if>
<if test="code != null">
code = #{code},
</if>
<if test="minNumber != null and minNumber != ''">
minNumber = #{minNumber},
</if>
<if test="maxNumber != null and maxNumber != ''">
maxNumber = #{maxNumber}
</if>
</set>
WHERE id = #{id}
</update>
<!-- 批量修改数据
<update id="updateDepositorys" parameterType="list">
<foreach collection="list" index="index" item="item" separator=";">
UPDATE depository
<set>
<if test="item.dname != null">
dname = #{item.dname},
</if>
<if test="item.address != null">
address = #{item.address},
</if>
<if test="item.introduce != null">
introduce = #{item.introduce}
</if>
</set>
WHERE id = #{item.id}
</foreach>
</update>-->
<!-- 根据主键删除数据 -->
<delete id="deleteDepositoryRecordById" parameterType="int">
DELETE FROM depository WHERE id = #{id}
</delete>
<!-- 根据主键批量删除数据-->
<delete id="deleteDepositoryRecordByIds" parameterType="list">
DELETE FROM depository WHERE id IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 根据主键将状态改为删除-->
<update id="changeStateToDeletedById" parameterType="int">
UPDATE depository
<set>
state = 3
</set>
WHERE id = #{id}
</update>
<update id="updateStateByParam" parameterType="map">
UPDATE depository
<set>
state = #{state}
</set>
where id = #{id}
<if test="oldState != null">
and state = #{oldState}
</if>
and state != 3
</update>
<!-- 根据主键批量将状态改为删除-->
<update id="changeStateToDeletedByIds" parameterType="list">
update depository
<set>
state = 3
</set>
where id in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<!-- 获取仓库总数-->
<select id="findAllCountByState" resultType="int">
select count(*)
from depository d
where d.state != 3
</select>
<select id="getToDayInventoryByDName" resultType="int" parameterType="map">
select ifnull(sum(quantity),0.0)
from depositoryAndmaterial
where 1 = 1
<if test="dname != null and dname !=''">
and dname = #{dname}
</if>
<if test="dcode != null and dcode !=''">
and dcode = #{dcode}
</if>
</select>
<select id="getToDayInventoryByDNameTest" resultMap="inventoryByDname">
select ifnull(sum(quantity),0.0) as inventory ,dname
from depositoryAndmaterial
where 1 = 1
GROUP BY dname
</select>
<select id="findUserNameByDepositoryId" resultType="string" parameterType="int">
select uname
from depositoryanduser
where did = #{depositoryId}
</select>
</mapper>

1250
target/classes/com/dreamchaser/depository_manage/mapper/DepositoryRecordMapper.xml

File diff suppressed because it is too large

908
target/classes/com/dreamchaser/depository_manage/mapper/MaterialMapper.xml

@ -1,908 +0,0 @@
<?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">
<!-- 产品信息记录(库存)(material) -->
<mapper namespace="com.dreamchaser.depository_manage.mapper.MaterialMapper">
<!-- This code was generated by TableGo tools, mark 1 begin. -->
<!-- 字段映射 -->
<resultMap id="materialMap" type="com.dreamchaser.depository_manage.entity.Material">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="depository_id" property="depositoryId" jdbcType="INTEGER" />
<result column="mname" property="mname" jdbcType="VARCHAR" />
<result column="quantity" property="quantity" jdbcType="VARCHAR" />
<result column="price" property="price" jdbcType="INTEGER" />
<result column="type_id" property="materialTypeId" jdbcType="INTEGER" />
<result column="state" property="state" jdbcType="INTEGER" />
<result column="code" property="code" jdbcType="VARCHAR"/>
<result column="version" property="version" jdbcType="VARCHAR"/>
<result column="amounts" property="amounts" jdbcType="INTEGER"/>
<result column="unit" property="unit" jdbcType="VARCHAR"/>
<result column="texture" property="texture" jdbcType="VARCHAR"/>
<result column="number_of_temporary" property="numberOfTemporary" jdbcType="INTEGER"/>
<result column="producedDate" property="producedDate" jdbcType="INTEGER"/>
<result column="shelfLife" property="shelfLife" jdbcType="INTEGER"/>
<result column="productionPlace" property="productionPlace" jdbcType="VARCHAR"/>
<result column="brand" property="brand" jdbcType="VARCHAR"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/>
</resultMap>
<!-- 字段映射-->
<resultMap id="materialAndTypeMap" type="com.dreamchaser.depository_manage.entity.Material">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="depository_id" property="depositoryId" jdbcType="INTEGER" />
<result column="mname" property="mname" jdbcType="VARCHAR" />
<result column="quantity" property="quantity" jdbcType="VARCHAR" />
<result column="price" property="price" jdbcType="VARCHAR" />
<result column="type_id" property="materialTypeId" jdbcType="INTEGER" />
<result column="state" property="state" jdbcType="VARCHAR" />
<result column="code" property="code" jdbcType="VARCHAR"/>
<result column="version" property="version" jdbcType="VARCHAR"/>
<result column="amounts" property="amounts" jdbcType="DOUBLE"/>
<result column="unit" property="unit" jdbcType="VARCHAR"/>
<result column="texture" property="texture" jdbcType="VARCHAR"/>
<result column="depositoryCode" property="depositoryCode" jdbcType="VARCHAR"/>
<result column="producedDate" property="producedDate" jdbcType="INTEGER"/>
<result column="shelfLife" property="shelfLife" jdbcType="INTEGER"/>
<result column="productionPlace" property="productionPlace" jdbcType="VARCHAR"/>
<result column="brand" property="brand" jdbcType="VARCHAR"/>
<result column="remark" property="remark" jdbcType="VARCHAR"/>
<association property="materialType" column="typeId" javaType="com.dreamchaser.depository_manage.entity.MaterialType">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="tname" property="tname" jdbcType="VARCHAR" />
<result column="introduce" property="introduce" jdbcType="VARCHAR" />
</association>
<association property="depository" column="depositoryId" javaType="com.dreamchaser.depository_manage.entity.Depository">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="dname" property="dname" jdbcType="VARCHAR" />
<result column="address" property="address" jdbcType="VARCHAR" />
<result column="introduce" property="introduce" jdbcType="VARCHAR" />
</association>
</resultMap>
<!-- 当前批次中物料与生产日期字段映射-->
<resultMap id="MaterialAndProducedDate" type="com.dreamchaser.depository_manage.entity.MaterialAndProducedDate">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="inid" property="inid" jdbcType="INTEGER" />
<result column="mid" property="mid" jdbcType="INTEGER" />
<result column="quantity" property="quantity" jdbcType="INTEGER" />
<result column="expendnum" property="expendnum" jdbcType="INTEGER" />
<result column="inventory" property="inventory" jdbcType="INTEGER" />
<result column="producedDate" property="producedDate" jdbcType="INTEGER" />
<result column="barCode" property="barCode" jdbcType="VARCHAR" />
<result column="qrCode" property="qrCode" jdbcType="VARCHAR" />
</resultMap>
<!-- 条形码与物料对应-->
<resultMap id="BarCodeAndMaterialMap" type="com.dreamchaser.depository_manage.entity.MaterialAndBarCode">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="price" property="price" jdbcType="INTEGER" />
<result column="texture" property="texture" jdbcType="VARCHAR"/>
<result column="mname" property="mname" jdbcType="VARCHAR"/>
<result column="unit" property="unit" jdbcType="VARCHAR"/>
<result column="version" property="version" jdbcType="VARCHAR"/>
<result column="tname" property="tname" jdbcType="VARCHAR"/>
<result column="mcode" property="mcode" jdbcType="VARCHAR"/>
<result column="bmcode" property="bmcode" jdbcType="VARCHAR"/>
<result column="mid" property="mid" jdbcType="INTEGER"/>
<result column="mtid" property="mtid" jdbcType="INTEGER"/>
<result column="shelfLife" property="shelfLife" jdbcType="INTEGER"/>
</resultMap>
<!-- 表查询字段 -->
<sql id="allColumns">
m.id, m.depository_id, m.mname, m.quantity, m.price, m.type_id,m.state,m.code ,m.version ,m.amounts ,m.unit ,m.texture,m.depositoryCode,m.number_of_temporary,m.shelfLife,m.producedDate,m.productionPlace,m.brand,m.remark
</sql>
<!-- 表查询字段,包括物料类型 -->
<sql id="allColumnsAndTypeName">
id,depository_id,mname,quantity,price,type_id,state,code ,version ,amounts ,unit ,texture,tname,depositoryCode,dname,producedDate,shelfLife,productionPlace,brand,remark
</sql>
<!-- 表查询字段,包括物料类型 用于视图-->
<sql id="allColumnsAndTypeNameOnView">
id,depository_id,mname,quantity,price,type_id,state,tname,dname,version,amounts ,unit ,texture,code,depositoryCode,producedDate,shelfLife,productionPlace,brand,remark
</sql>
<sql id="allColumnsByMaterialAndProducedDate">
mp.id,mp.inid,mp.mid,mp.quantity,mp.expendnum,mp.inventory,mp.producedDate,mp.barCode,mp.qrCode
</sql>
<!-- 表查询字段,用于查询物料与条形码视图-->
<sql id="materialAndBarCode">
id,bmcode,mcode,mid,depositoryId,mname,mtid,version,texture,unit,tname,price,shelfLife
</sql>
<!-- 查询所有数据的条数 -->
<select id="findCount" resultType="integer">
SELECT
count(*)
FROM material m
where m.depository_id is null
</select>
<!-- 查询所有符合条件的数据条数 -->
<select id="findCountByCondition" parameterType="map" resultType="integer">
SELECT
count(*)
FROM material m WHERE 1 = 1
<if test="depositoryId != null">
AND m.depository_id = #{depositoryId}
</if>
<if test="mname != null and mname != ''">
AND m.mname LIKE CONCAT('%', #{mname}, '%')
</if>
<if test="quantity != null">
AND m.quantity = #{quantity}
</if>
<if test="price != null">
AND m.price = #{price}
</if>
<if test="materialTypeId != null">
AND m.type_id = #{materialTypeId}
</if>
<if test="code != null and code != '' ">
and m.code = #{code}
</if>
<if test="shelfLife != null">
and #{shelfLife} >= shelfLife
</if>
<if test="producedDate != null">
and producedDate >= #{producedDate}
</if>
<if test="productionPlace != null and productionPlace !=''">
and productionPlace = #{productionPlace}
</if>
<if test="brand != '' and brand != null">
and brand = #{brand}
</if>
<if test="remark != '' and remark != null">
and remark = #{remark}
</if>
and state != 3 and m.depository_id is null
</select>
<!-- 根据条件参数查询数据列表 -->
<select id="findMaterialByCondition" resultMap="materialMap" parameterType="map">
SELECT
<include refid="allColumnsAndTypeNameOnView" />
from findMaterial
where 1 = 1
<if test="mid != null">
and id = #{mid}
</if>
<if test="depositoryId != null">
AND depository_id = #{depositoryId}
</if>
<if test="mname != null and mname != ''">
AND mname LIKE CONCAT('%', #{mname}, '%')
</if>
<if test="quantity != null">
AND quantity = #{quantity}
</if>
<if test="price != null">
AND price = #{price}
</if>
<if test="materialTypeId != null">
AND type_id = #{materialTypeId}
</if>
<if test="state != null and state != ''">
And state = #{state}
</if>
<if test="code != null and code != '' ">
and code = #{code}
</if>
<if test="shelfLife != null">
and #{shelfLife} >= shelfLife
</if>
<if test="producedDate != null">
and producedDate >= #{producedDate}
</if>
<if test="productionPlace != null and productionPlace !=''">
and productionPlace = #{productionPlace}
</if>
<if test="brand != '' and brand != null">
and brand LIKE CONCAT('%', #{brand}, '%')
</if>
<if test="remark != '' and remark != null">
and remark LIKE CONCAT('%', #{remark}, '%')
</if>
and depository_id is null
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
</select>
<!-- 根据物料id查询所有物料与生产日期的对应-->
<select id="findMaterialAndProducedDateByMid" resultMap="MaterialAndProducedDate" parameterType="int">
select
<include refid="allColumnsByMaterialAndProducedDate"/>
from materialandproduceddate mp
where mp.mid = #{mid} and mp.inventory != 0 and producedDate is not null ORDER BY producedDate
</select>
<!-- 根据物料id与生产日期获取对应关系-->
<select id="findMaterialAndProducedDateByMidAndProducedDate" resultMap="MaterialAndProducedDate" parameterType="map">
select
<include refid="allColumnsByMaterialAndProducedDate"/>
from materialandproduceddate mp
where 1 = 1
<if test="mid != null and mid != ''">
and mp.mid = #{mid}
</if>
<if test="producedDate != null">
and mp.producedDate = #{producedDate}
</if>
</select>
<!--根据条件查询库存-->
<select id="findInventory" resultMap="materialMap" parameterType="map">
SELECT
<include refid="allColumnsAndTypeNameOnView" />
from findMaterial
where 1 = 1
<if test="mid != null">
and id = #{mid}
</if>
<if test="depositoryId != null">
AND depository_id = #{depositoryId}
</if>
<if test="mname != null and mname != ''">
AND mname LIKE CONCAT('%', #{mname}, '%')
</if>
<if test="quantity != null">
AND quantity = #{quantity}
</if>
<if test="price != null">
AND price = #{price}
</if>
<if test="materialTypeId != null">
AND type_id = #{materialTypeId}
</if>
<if test="state != null and state != ''">
And state = #{state}
</if>
<if test="code != null and code != '' ">
and code = #{code}
</if>
<if test="shelfLife != null">
and #{shelfLife} >= shelfLife
</if>
<if test="producedDate != null">
and producedDate >= #{producedDate}
</if>
<if test="productionPlace != null and productionPlace !=''">
and productionPlace = #{productionPlace}
</if>
<if test="brand != '' and brand != null">
and brand LIKE CONCAT('%', #{brand}, '%')
</if>
<if test="remark != '' and remark != null">
and remark LIKE CONCAT('%', #{remark}, '%')
</if>
and depository_id is not null
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
</select>
<select id="findMaterialCount" parameterType="map" resultType="int">
select count(*)
from material m
where 1 = 1
<if test="mid != null">
and m.id = #{mid}
</if>
<if test="mname != null and mname != ''">
AND m.mname LIKE CONCAT('%', #{mname}, '%')
</if>
<if test="quantity != null">
AND m.quantity = #{quantity}
</if>
<if test="price != null">
AND m.price = #{price}
</if>
<if test="materialTypeId != null">
AND m.type_id = #{materialTypeId}
</if>
<if test="state != null and state != ''">
And m.state = #{state}
</if>
<if test="code != null and code != '' ">
and m.code = #{code}
</if>
<if test="shelfLife != null">
and #{shelfLife} >= m.shelfLife
</if>
<if test="producedDate != null">
and m.producedDate >= #{producedDate}
</if>
<if test="productionPlace != null and productionPlace !=''">
and m.productionPlace = #{productionPlace}
</if>
<if test="brand != '' and brand != null">
and m.brand LIKE CONCAT('%', #{brand}, '%')
</if>
<if test="remark != '' and remark != null">
and m.remark LIKE CONCAT('%', #{remark}, '%')
</if>
and m.depository_id is null
</select>
<!--根据条件查询库存数量-->
<select id="findInventoryCount" parameterType="map" resultType="int">
SELECT
count(*)
from findMaterial
where 1 = 1
<if test="mid != null">
and id = #{mid}
</if>
<if test="depositoryId != null">
AND depository_id = #{depositoryId}
</if>
<if test="mname != null and mname != ''">
AND mname LIKE CONCAT('%', #{mname}, '%')
</if>
<if test="quantity != null">
AND quantity = #{quantity}
</if>
<if test="price != null">
AND price = #{price}
</if>
<if test="materialTypeId != null">
AND type_id = #{materialTypeId}
</if>
<if test="state != null and state != ''">
And state = #{state}
</if>
<if test="code != null and code != '' ">
and code = #{code}
</if>
<if test="shelfLife != null">
and #{shelfLife} >= shelfLife
</if>
<if test="producedDate != null">
and producedDate >= #{producedDate}
</if>
<if test="productionPlace != null and productionPlace !=''">
and productionPlace = #{productionPlace}
</if>
<if test="brand != '' and brand != null">
and brand LIKE CONCAT('%', #{brand}, '%')
</if>
<if test="remark != '' and remark != null">
and remark LIKE CONCAT('%', #{remark}, '%')
</if>
and depository_id is not null
</select>
<!-- 根据仓库查询物料-->
<select id="findMaterialByDepositorys" resultMap="materialMap" parameterType="list">
SELECT
<include refid="allColumns" />
from material m
where m.depository_id in
<foreach collection="list" index="index" item="item" open="("
separator="," close=")">
#{item}
</foreach>
</select>
<select id="findMaterialByTypeIds" resultMap="materialMap" parameterType="list">
SELECT
<include refid="allColumns" />
from material m
where m.type_id in
<foreach collection="list" index="index" item="item" open="("
separator="," close=")">
#{item}
</foreach>
and state = 1;
</select>
<select id="findMaterialByDepositorysAndType" resultMap="materialMap" parameterType="map">
SELECT
<include refid="allColumns" />
from material m
where m.depository_id in
<foreach collection="list" index="index" item="item" open="("
separator="," close=")">
#{item}
</foreach>
and m.type_id = #{materialTypeId}
</select>
<!-- 根据条形码查询物料-->
<select id="findMaterialByBarCodeByCondition" resultMap="BarCodeAndMaterialMap" parameterType="map">
select
<include refid="materialAndBarCode" />
from materialandbarcode
where 1 = 1
<if test="barCode != null and barCode != ''">
and bmcode = #{barCode}
</if>
<if test="mcode != null and mcode != ''">
and mcode = #{mcode}
</if>
<if test="mid != null">
and mid = #{mid}
</if>
<if test="id != null and id != ''">
and id = #{id}
</if>
<if test="depositoryId != null and depositoryId != ''">
and depositoryId = #{depositoryId}
</if>
<if test="mname != null and mname != ''">
AND mname LIKE CONCAT('%', #{mname}, '%')
</if>
<if test="typeId != null">
and mtid = #{typeId}
</if>
<if test="tname != null and tname != ''">
AND tname LIKE CONCAT('%', #{tname}, '%')
</if>
<if test="shelfLife != null">
and #{shelfLife} >= shelfLife
</if>
<if test="producedDate != null">
and producedDate >= #{producedDate}
</if>
<if test="productionPlace != null and productionPlace !=''">
and productionPlace = #{productionPlace}
</if>
<if test="brand != '' and brand != null">
and brand LIKE CONCAT('%', #{brand}, '%')
</if>
<if test="remark != '' and remark != null">
and remark LIKE CONCAT('%', #{remark}, '%')
</if>
group by bmcode
</select>
<!-- 根据物料编码code查询对应的二维码-->
<select id="findMaterialByBarCodeByMcode" resultMap="BarCodeAndMaterialMap" parameterType="String">
select
<include refid="materialAndBarCode" />
from materialandbarcode
where 1 = 1
<if test="mcode != null and mcode != ''">
and mcode = #{mcode}
</if>
group by mcode
</select>
<select id="findMaterialByBarCodeCountByCondition" resultType="int" parameterType="map">
select count(*)
from barcodeandmaterial
where 1 = 1
<if test="barCode != null and barCode != ''">
and barCode = #{barCode}
</if>
<if test="mcode != null and mcode != ''">
and mcode = #{mcode}
</if>
</select>
<!-- 根据仓库查询物料-->
<select id="findMaterialByDepository" resultMap="materialMap" parameterType="map">
SELECT
<include refid="allColumns" />
from material m
where m.depository_id = #{depositoryId}
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
</select>
<!-- 根据仓库查询物料总数-->
<select id="findMaterialByDepositoryCount" resultType="int" parameterType="map">
SELECT
COUNT(*)
from material m
where m.depository_id = #{depositoryId}
</select>
<!-- 根据主键查询数据 -->
<select id="findMaterialById" resultMap="materialMap" parameterType="integer">
SELECT
<include refid="allColumns" />
FROM material m WHERE m.id =#{id}
</select>
<select id="findMaterialAndTypeById" resultMap="materialAndTypeMap" parameterType="integer">
select
<include refid="allColumnsAndTypeName"/>
from materialAndType
where id = #{id}
</select>
<select id="findMaterialByType" resultMap="materialMap" parameterType="long">
select
<include refid="allColumns"/>
from material m
where m.type_id = #{oldId}
</select>
<!-- 根据主键查询数据 -->
<select id="findMaterialByIds" resultMap="materialMap" parameterType="list">
SELECT
<include refid="allColumns" />
FROM material m WHERE m.id IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<!-- 插入数据 -->
<insert id="insertMaterial" useGeneratedKeys="true" keyProperty="id">
INSERT INTO material (
id, depository_id, mname, quantity, price, type_id,code,unit,version,texture,amounts,depositoryCode,producedDate,shelfLife,brand,productionPlace,remark
) VALUES (
#{id},
<if test="depositoryId != null">
#{depositoryId},
</if>
<if test="depositoryId == null">
null,
</if>
#{mname},
<if test="quantity != null">
#{quantity},
</if>
<if test="quantity == null">
0,
</if>
<if test="price != null">
#{price},
</if>
<if test="price == null">
0,
</if>
#{materialTypeId},
#{code},
#{unit},
#{version},
#{texture},
<if test="amounts != null">
#{amounts},
</if>
<if test="amounts == null">
0,
</if>
<if test="depositoryCode != null">
#{depositoryCode},
</if>
<if test="depositoryCode == null">
'',
</if>
#{producedDate},
#{shelfLife},
#{brand},
#{productionPlace},
#{remark}
)
</insert>
<!-- 添加当前批次物料与生产日期对应-->
<insert id="addMaterialAndProducedDate" useGeneratedKeys="true" keyProperty="id">
insert into materialandproduceddate(id,inid,mid,quantity,expendnum,inventory,producedDate,barCode,qrCode)
values (
#{id},
#{inid},
#{mid},
#{quantity},
#{expendnum},
#{inventory},
#{producedDate},
#{barCode},
#{qrCode}
)
</insert>
<insert id="addBarCodeAndMcode" parameterType="map">
insert into barcodeandmaterial(id,barCode,mcode)
values (
#{id},
#{barCode},
#{code}
)
</insert>
<insert id="addBarCodeAndMaterialForMoreOne" parameterType="map">
insert into barcodeandmaterial(id,mcode,barCode)
values
<foreach collection="list" index="index" item="item" separator=",">
(#{id},
#{code},
#{item})
</foreach>
</insert>
<!-- 批量插入数据-->
<insert id="insertMaterials" parameterType="list">
INSERT INTO material (
id, depository_id, mname, quantity, price, type_id,code,unit,version,texture,amounts,depositoryCode
) VALUES
<foreach collection="list" index="index" item="item" separator=",">
(
#{item.id},
#{item.depositoryId},
#{item.mname},
#{item.quantity},
#{item.price},
#{item.typeId},
#{item.code},
#{item.unit},
#{item.version},
#{item.texture},
#{item.amounts},
#{item.depositoryCode}
)
</foreach>
</insert>
<!-- 删除映射-->
<delete id="deleteBarCodeAndMaterial" parameterType="map">
delete
from barcodeandmaterial
where 1 = 1
<if test="barCode != null and barCode != ''">
and barCode = #{barCode}
</if>
<if test="mcode != null and mcode != ''">
and mcode = #{mcode}
</if>
<if test="id != null and id != ''">
and id = #{id}
</if>
</delete>
<update id="updateMaterialAndProducedDate">
update materialandproduceddate
<set>
<if test="inid != null and inid != ''">
inid = #{inid},
</if>
<if test="mid != null and mid != ''">
mid = #{mid},
</if>
<if test="quantity != null">
quantity = #{quantity},
</if>
<if test="expendnum != null">
expendnum = #{expendnum},
</if>
<if test="inventory != null">
inventory = #{inventory},
</if>
<if test="producedDate != null">
producedDate = #{producedDate},
</if>
<if test="barCode != null">
barCode = #{barCode},
</if>
<if test="qrCode != null">
qrCode = #{qrCode}
</if>
</set>
where id = #{id}
</update>
<!-- 修改数据 -->
<update id="updateMaterial">
UPDATE material
<set>
<if test="depositoryId != null">
depository_id = #{depositoryId},
</if>
<if test="mname != null">
mname = #{mname},
</if>
<if test="quantity != null">
quantity = #{quantity},
</if>
<if test="price != null">
price = #{price},
</if>
<if test="materialTypeId != null">
type_id = #{materialTypeId},
</if>
<if test="state != null and state != ''">
state = #{state},
</if>
<if test="amounts != null and amounts != ''">
amounts = #{amounts},
</if>
<if test="version != null and version != ''">
version = #{version},
</if>
<if test="code != null and code != ''">
code = #{code},
</if>
<if test="unit != null and unit != ''">
unit = #{unit},
</if>
<if test="depositoryCode != null and depositoryCode !=''">
depositoryCode = #{depositoryCode},
</if>
<if test="numberOfTemporary != null">
number_of_temporary = #{numberOfTemporary},
</if>
<if test="texture != null and texture != ''">
texture = #{texture},
</if>
<if test="shelfLife != null">
shelfLife = #{shelfLife},
</if>
<if test="producedDate != null">
producedDate = #{producedDate},
</if>
<if test="productionPlace != null and productionPlace !=''">
productionPlace = #{productionPlace},
</if>
<if test="brand != '' and brand != null">
brand = #{brand},
</if>
<if test="remark != '' and remark != null">
remark = #{remark}
</if>
</set>
WHERE id = #{id}
</update>
<!-- 修改数据 -->
<update id="updateInventory">
UPDATE material
<set>
<if test="depositoryId != null">
depository_id = #{depositoryId},
</if>
<if test="mname != null">
mname = #{mname},
</if>
<if test="materialTypeId != null">
type_id = #{materialTypeId},
</if>
<if test="state != null and state != ''">
state = #{state},
</if>
<if test="version != null and version != ''">
version = #{version},
</if>
<if test="code != null and code != ''">
code = #{code},
</if>
<if test="unit != null and unit != ''">
unit = #{unit},
</if>
<if test="depositoryCode != null and depositoryCode !=''">
depositoryCode = #{depositoryCode},
</if>
<if test="numberOfTemporary != null">
number_of_temporary = #{numberOfTemporary},
</if>
<if test="texture != null and texture != ''">
texture = #{texture},
</if>
<if test="shelfLife != null">
shelfLife = #{shelfLife},
</if>
<if test="producedDate != null">
producedDate = #{producedDate},
</if>
<if test="productionPlace != null and productionPlace !=''">
productionPlace = #{productionPlace},
</if>
<if test="brand != '' and brand != null">
brand = #{brand},
</if>
<if test="remark != '' and remark != null">
remark = #{remark}
</if>
</set>
WHERE id in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<!-- 根据仓库id和物料名称改变物料的数量 -->
<update id="changeMaterial" parameterType="map">
UPDATE material
<set>
<if test='state == "已入库"'>
<if test="price != null">
quantity = quantity+#{quantity},
</if>
<if test="price != null">
price = price + #{price}
</if>
</if>
<if test='state == "已出库"'>
<if test="price != null">
quantity = quantity - #{quantity},
</if>
<if test="price != null">
price = price - #{price}
</if>
</if>
</set>
WHERE
depository_id = #{depositoryId} and mname = #{mname},
</update>
<!-- 根据主键删除数据 -->
<delete id="deleteMaterialById" parameterType="int">
DELETE FROM material WHERE id = #{id}
</delete>
<!-- 根据主键批量删除数据
<delete id="deleteMaterialByIds" parameterType="list">
DELETE FROM material WHERE id IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>-->
<!-- 根据主键将状态改为删除-->
<update id="changeStateToDeletedById" parameterType="int">
UPDATE material
<set>
state = 3
</set>
WHERE id = #{id}
</update>
<update id="updateStateByParam" parameterType="map">
UPDATE material
<set>
state = #{state}
</set>
where id = #{id}
<if test="oldState != null">
and state = #{oldState}
</if>
and state != 3
</update>
<!-- 根据主键批量将状态改为删除-->
<update id="changeStateToDeletedByIds" parameterType="list">
update material
<set>
state = 3
</set>
where id in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>

260
target/classes/com/dreamchaser/depository_manage/mapper/MaterialTypeMapper.xml

@ -1,260 +0,0 @@
<?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">
<!-- material_type -->
<mapper namespace="com.dreamchaser.depository_manage.mapper.MaterialTypeMapper">
<!-- This code was generated by TableGo tools, mark 1 begin. -->
<!-- 字段映射 -->
<resultMap id="materialTypeMap" type="com.dreamchaser.depository_manage.entity.MaterialType">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="tname" property="tname" jdbcType="VARCHAR" />
<result column="introduce" property="introduce" jdbcType="VARCHAR" />
<result column="state" property="state" jdbcType="INTEGER"/>
<result column="parentId" property="parentId" jdbcType="INTEGER"/>
<result column="oldId" property="oldId" jdbcType="INTEGER"/>
</resultMap>
<!-- 表查询字段 -->
<sql id="allColumns">
mt.id, mt.tname, mt.introduce, mt.state,mt.parentId,mt.oldId
</sql>
<!-- This code was generated by TableGo tools, mark 2 end. -->
<!-- 查询所有数据 -->
<select id="findMaterialTypeAll" resultMap="materialTypeMap">
SELECT
<include refid="allColumns" />
FROM material_type mt
where mt.state != 3 and mt.state != 4
</select>
<!-- 查询所有顶级父类 -->
<select id="findMaterialTypeNoParent" resultMap="materialTypeMap">
select
<include refid="allColumns" />
FROM material_type mt
where mt.state != 3 and mt.state != 4 and mt.parentId = 0
</select>
<select id="findMaterialTypeCountByCondition" resultType="int" parameterType="map">
select count(*)
FROM material_type mt WHERE 1 = 1
<if test="tname != null and tname != ''">
AND mt.tname LIKE CONCAT('%', #{tname}, '%')
</if>
<if test="introduce != null and introduce != ''">
AND mt.introduce LIKE CONCAT('%', #{introduce}, '%')
</if>
<if test="state != null and state != ''" >
and mt.state = #{state}
</if>
<if test="parentId != null">
and mt.parentId = #{parentId}
</if>
<if test="oldId != null">
and mt.oldId = #{oldId}
</if>
and mt.state != 3 and mt.state != 4
</select>
<!-- 根据条件参数查询数据列表 -->
<select id="findMaterialTypeByCondition" resultMap="materialTypeMap" parameterType="map">
SELECT
<include refid="allColumns" />
FROM material_type mt WHERE 1 = 1
<if test="tname != null and tname != ''">
AND mt.tname LIKE CONCAT('%', #{tname}, '%')
</if>
<if test="introduce != null and introduce != ''">
AND mt.introduce LIKE CONCAT('%', #{introduce}, '%')
</if>
<if test="state != null and state != ''" >
and mt.state = #{state}
</if>
<if test="parentId != null">
and mt.parentId = #{parentId}
</if>
<if test="oldId != null">
and mt.oldId = #{oldId}
</if>
and mt.state != 3 and mt.state != 4
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
</select>
<!-- 根据主键查询数据 -->
<select id="findMaterialTypeNameById" resultType="string" parameterType="integer">
SELECT
mt.tname
FROM material_type mt WHERE mt.id = #{id}
</select>
<!-- 根据物料类型id查询数据 -->
<select id="findMaterialTypeNameByOldId" resultType="string" parameterType="long">
SELECT
mt.tname
FROM material_type mt WHERE mt.oldId = #{oldId}
</select>
<!-- 根据父类查询数据 -->
<select id="findMaterialTypeByParent" resultMap="materialTypeMap" parameterType="long">
SELECT
<include refid="allColumns" />
FROM material_type mt
WHERE mt.parentId = #{parentId}
</select>
<!-- 根据主键批量获取数据 -->
<select id="findMaterialTypeByOldIds" resultMap="materialTypeMap" parameterType="list">
SELECT
<include refid="allColumns" />
FROM material_type mt
WHERE mt.oldId in
<foreach collection="list" index="index" item="item" open="("
separator="," close=")">
#{item}
</foreach>
</select>
<!-- 根据主键查询数据 -->
<select id="findMaterialTypeById" resultMap="materialTypeMap" parameterType="integer">
SELECT
<include refid="allColumns" />
FROM material_type mt WHERE mt.oldId = #{id} and mt.state != 3 and mt.state != 4
</select>
<!-- 根据主键查询数据 -->
<select id="findMaterialTypeByOldId" resultMap="materialTypeMap" parameterType="long">
SELECT
<include refid="allColumns" />
FROM material_type mt WHERE mt.oldId = #{oldId} and mt.state != 3 and mt.state != 4
</select>
<!-- 根据主键查询数据
<select id="findMaterialTypeByIds" resultMap="materialTypeMap" parameterType="list">
SELECT
<include refid="allColumns" />
FROM material_type mt WHERE mt.id IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>-->
<!-- 插入数据 -->
<insert id="insertMaterialType" parameterType="map">
INSERT INTO material_type (
id, tname, introduce,parentId,oldId
) VALUES (
#{id},
#{tname},
#{introduce},
#{parentId},
#{oldId}
)
</insert>
<!-- 批量插入数据
<insert id="insertMaterialTypes" parameterType="list">
INSERT INTO material_type (
id, tname, introduce
) VALUES
<foreach collection="list" index="index" item="item" separator=",">
(
#{item.id},
#{item.tname},
#{item.introduce}
)
</foreach>
</insert>-->
<!-- 修改数据 -->
<update id="updateMaterialType" parameterType="map">
UPDATE material_type
<set>
<if test="tname != null">
tname = #{tname},
</if>
<if test="introduce != null">
introduce = #{introduce},
</if>
<if test="state != null">
state = #{state},
</if>
<if test="parentId != null">
parentId = #{parentId}
</if>
</set>
WHERE oldId = #{id}
</update>
<!-- 批量修改数据 -->
<update id="updateMaterialTypes" parameterType="list">
<foreach collection="list" index="index" item="item" separator=";">
UPDATE material_type
<set>
<if test="item.tname != null">
tname = #{item.tname},
</if>
<if test="item.introduce != null">
introduce = #{item.introduce}
</if>
<if test="state != null">
state = #{state}
</if>
<if test="parentId != null">
parentId = #{parentId}
</if>
</set>
WHERE oldId = #{item.id}
</foreach>
</update>
<!-- 根据主键删除数据 -->
<delete id="deleteMaterialTypeById" parameterType="int">
DELETE FROM material_type WHERE oldId = #{id}
</delete>
<!-- 根据主键批量删除数据-->
<delete id="deleteMaterialTypeByIds" parameterType="list">
DELETE FROM material_type WHERE oldId IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!-- 根据主键将状态改为删除-->
<update id="changeStateToDeletedById" parameterType="int">
update material_type
<set>
state = 3
</set>
where oldId = #{id}
</update>
<!-- 根据主键批量将状态改为删除-->
<update id="changeStateToDeletedByIds" parameterType="list">
update material_type
<set>
state = 3
</set>
where oldId in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="updateStateByParam" parameterType="map">
update material_type
<set>
state = #{state}
</set>
where id = #{id}
<if test="oldState != null">
and state = #{oldState}
</if>
and state != 3 and state != 4
</update>
</mapper>

131
target/classes/com/dreamchaser/depository_manage/mapper/NoticeMapper.xml

@ -1,131 +0,0 @@
<?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">
<!-- notice -->
<mapper namespace="com.dreamchaser.depository_manage.mapper.NoticeMapper">
<!-- This code was generated by TableGo tools, mark 1 begin. -->
<!-- 字段映射 -->
<resultMap id="noticeMap" type="com.dreamchaser.depository_manage.entity.Notice">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="title" property="title" jdbcType="VARCHAR" />
<result column="content" property="content" jdbcType="VARCHAR" />
<result column="time" property="time" jdbcType="INTEGER" />
</resultMap>
<!-- 表查询字段 -->
<sql id="allColumns">
n.id, n.title, n.content, n.time
</sql>
<!-- 查询所有 -->
<select id="findNoticeAll" resultMap="noticeMap">
SELECT
<include refid="allColumns" />
FROM notice n
</select>
<!-- 根据条件参数查询列表 -->
<select id="findNoticeByCondition" resultMap="noticeMap" parameterType="map">
SELECT
<include refid="allColumns" />
FROM notice n WHERE 1 = 1
<if test="title != null and title != ''">
AND n.title LIKE CONCAT('%', #{title}, '%')
</if>
<if test="content != null and content != ''">
AND n.content LIKE CONCAT('%', #{content}, '%')
</if>
<if test="time != null">
AND n.time = #{time}
</if>
order by n.time DESC
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
</select>
<!-- 根据主键查询信息 -->
<select id="findNoticeByIds" resultMap="noticeMap" parameterType="list">
SELECT
<include refid="allColumns" />
FROM notice n WHERE n.id IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<!-- 新增信息 -->
<insert id="addNotice">
INSERT INTO notice (
title, content, time
) VALUES (
#{title},
#{content},
#{time}
)
</insert>
<!-- 批量新增信息 -->
<insert id="addNotices" parameterType="list">
INSERT INTO notice (
id, title, content, time
) VALUES
<foreach collection="list" index="index" item="item" separator=",">
(
#{item.id},
#{item.title},
#{item.content},
#{item.time}
)
</foreach>
</insert>
<!-- 修改信息 -->
<update id="updateNotice">
UPDATE notice
<set>
<if test="title != null">
title = #{title},
</if>
<if test="content != null">
content = #{content},
</if>
<if test="time != null">
time = #{time}
</if>
</set>
WHERE id = #{id}
</update>
<!-- 批量修改信息 -->
<update id="updateNotices" parameterType="list">
<foreach collection="list" index="index" item="item" separator=";">
UPDATE notice
<set>
<if test="item.title != null">
title = #{item.title},
</if>
<if test="item.content != null">
content = #{item.content},
</if>
<if test="item.time != null">
time = #{item.time}
</if>
</set>
WHERE id = #{item.id}
</foreach>
</update>
<!-- 根据主键删除 -->
<delete id="deleteNoticeById" parameterType="int">
DELETE FROM notice WHERE id = #{id}
</delete>
<!-- 根据主键批量删除 -->
<delete id="deleteNoticeByIds" parameterType="list">
DELETE FROM notice WHERE id IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

316
target/classes/com/dreamchaser/depository_manage/mapper/PlaceMapper.xml

@ -1,316 +0,0 @@
<?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">
<!-- notice -->
<mapper namespace="com.dreamchaser.depository_manage.mapper.PlaceMapper">
<!-- This code was generated by TableGo tools, mark 1 begin. -->
<!-- 字段映射 -->
<resultMap id="placeMap" type="com.dreamchaser.depository_manage.entity.Place">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="x" property="x" jdbcType="INTEGER" />
<result column="y" property="y" jdbcType="INTEGER" />
<result column="z" property="z" jdbcType="INTEGER" />
<result column="mid" property="mid" jdbcType="INTEGER" />
<result column="did" property="did" jdbcType="INTEGER" />
<result column="code" property="code" jdbcType="VARCHAR" />
<result column="min" property="min" jdbcType="INTEGER" />
<result column="max" property="max" jdbcType="INTEGER" />
<result column="state" property="state" jdbcType="INTEGER" />
<result column="quantity" property="quantity" jdbcType="INTEGER" />
</resultMap>
<resultMap id="materialAndPlaceMap" type="com.dreamchaser.depository_manage.entity.MaterialAndPlace">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="mid" property="mid" jdbcType="INTEGER" />
<result column="pid" property="pid" jdbcType="INTEGER" />
<result column="did" property="did" jdbcType="INTEGER" />
<result column="quantity" property="quantity" jdbcType="INTEGER" />
<result column="max" property="max" jdbcType="INTEGER" />
<result column="min" property="min" jdbcType="INTEGER" />
<result column="code" property="code" jdbcType="VARCHAR" />
</resultMap>
<!-- 表查询字段 -->
<sql id="allColumns">
p.id,p.x,p.y,p.z,p.code,p.mid,p.did,p.min,p.max,p.state,p.quantity
</sql>
<sql id="allColumnsByMaterialAndPlace">
mp.id,mp.mid,mp.pid,mp.quantity,p.code,p.max,p.min,p.did
</sql>
<!-- 查询所有 -->
<select id="findPlaceAll" resultMap="placeMap">
SELECT
<include refid="allColumns" />
FROM place p
where p.state != 3
</select>
<select id="findPlaceByMidAndDid" resultMap="placeMap" parameterType="map">
SELECT
<include refid="allColumns" />
from materialandplace mp left join place p on p.id = mp.pid
where 1 = 1
<if test="mid != null and mid != ''">
and mp.mid = #{mid}
</if>
<if test="did != null and did != ''">
and ( p.did = #{did} or p.did = 0)
</if>
</select>
<!-- 根据条件参数查询列表 -->
<select id="findPlaceByCondition" resultMap="placeMap" parameterType="map">
SELECT
<include refid="allColumns" />
FROM place p WHERE 1 = 1
<if test="id != null and id != ''">
and p.id = #{id}
</if>
<if test="x != null and x != ''">
AND p.x = #{x}
</if>
<if test="y != null and y != ''">
AND p.y = #{y}
</if>
<if test="z != null and z != ''">
AND p.z = #{z}
</if>
<if test="code != null and code != ''">
AND p.code LIKE CONCAT('%', #{code}, '%')
</if>
<if test="mid != null and mid != ''">
AND find_in_set(#{mid},p.mid)
</if>
<if test="did != null and did != ''">
AND p.did = #{did}
</if>
<if test="max != null and max != ''">
AND p.max = #{max}
</if>
<if test="min != null and min != ''">
AND p.min = #{min}
</if>
<if test="state != null and state != ''">
and p.state = #{state}
</if>
and p.state != 3
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
</select>
<select id="findPlaceCountByCondition" parameterType="map" resultType="int">
SELECT
count(*)
FROM place p WHERE 1 = 1
<if test="id != null and id != ''">
and p.id = #{id}
</if>
<if test="x != null and x != ''">
AND p.x = #{x}
</if>
<if test="y != null and y != ''">
AND p.y = #{y}
</if>
<if test="code != null and code != ''">
AND p.code LIKE CONCAT('%', #{code}, '%')
</if>
<if test="z != null and z != ''">
AND p.z = #{z}
</if>
<if test="mid != null and mid != ''">
AND p.mid = #{mid}
</if>
<if test="did != null and did != ''">
AND p.did = #{did}
</if>
<if test="max != null and max != ''">
AND p.max = #{max}
</if>
<if test="min != null and min != ''">
AND p.min = #{min}
</if>
<if test="state != null and state != ''">
and p.state = #{state}
</if>
and p.state != 3
</select>
<select id="findPlaceByDid" parameterType="int" resultMap="placeMap">
SELECT
<include refid="allColumns" />
FROM place p WHERE 1 = 1 and p.did = #{did}
</select>
<select id="findPlaceByMid" parameterType="int" resultMap="placeMap">
SELECT
<include refid="allColumns" />
FROM materialandplace mp left join place p on p.id = mp.pid WHERE 1 = 1 and mp.mid = #{mid}
</select>
<select id="findQuantityByMidAndPid" parameterType="map" resultType="int">
select quantity
from materialandplace
where pid = #{pid} and mid = #{mid}
</select>
<!-- 根据主键查询信息 -->
<select id="findPlaceById" resultMap="placeMap" parameterType="int">
SELECT
<include refid="allColumns" />
FROM place p WHERE p.id = #{id}
</select>
<select id="findPlaceAndMaterialByPid" resultMap="materialAndPlaceMap" parameterType="int">
SELECT
<include refid="allColumnsByMaterialAndPlace" />
FROM materialandplace mp left join place p on p.id = mp.pid WHERE 1 = 1 and p.id = #{id}
</select>
<select id="findPlaceAndMaterialByMidAndPid" resultMap="materialAndPlaceMap" parameterType="map">
SELECT
<include refid="allColumnsByMaterialAndPlace" />
FROM materialandplace mp left join place p on p.id = mp.pid
where 1 = 1
<if test="mid != null">
and mp.mid = #{mid}
</if>
<if test="pid != null">
and mp.pid = #{pid}
</if>
</select>
<!-- 新增信息 -->
<insert id="InsertPlace">
INSERT INTO place (
id,x,y,z,code, mid,did,min,max,state,quantity
) VALUES (
#{id},
#{x},
#{y},
#{z},
#{code},
#{mid},
#{did},
#{min},
#{max},
#{state},
#{quantity}
)
</insert>
<insert id="addMaterialOnPlace">
insert into materialandplace(id,mid,pid,quantity)
values (
#{id},
#{mid},
#{pid},
#{quantity}
)
</insert>
<delete id="delMaterialOnPlace" parameterType="int">
DELETE FROM materialandplace WHERE id = #{id}
</delete>
<!-- 修改信息 -->
<update id="UpdatePlace">
UPDATE place
<set>
<if test="x != null">
x = #{x},
</if>
<if test="y != null">
y = #{y},
</if>
<if test="z != null">
z = #{z},
</if>
<if test="code != null">
code = #{code},
</if>
<if test="mid != null">
mid = #{mid},
</if>
<if test="did != null">
did = #{did},
</if>
<if test="min != null">
min = #{min},
</if>
<if test="max != null">
max = #{max},
</if>
<if test="state != null and state !=''">
state = #{state},
</if>
<if test="quantity != null">
quantity = #{quantity}
</if>
</set>
WHERE id = #{id}
</update>
<update id="updateMaterialAndPlace">
update materialandplace
<set>
<if test="mid != null">
mid = #{mid},
</if>
<if test="quantity != null">
quantity = #{quantity},
</if>
<if test="pid != null">
pid = #{pid}
</if>
</set>
where id = #{id}
</update>
<!-- 根据主键删除 -->
<delete id="DelPlace" parameterType="int">
DELETE FROM place WHERE id = #{id}
</delete>
<!-- 根据主键批量将状态改为删除-->
<update id="changeStateToDeletedByIds" parameterType="list">
update place
<set>
state = 3
</set>
where id in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<!-- 根据主键将状态改为删除-->
<update id="changeStateToDeletedById" parameterType="int">
UPDATE place
<set>
state = 3
</set>
WHERE id = #{id}
</update>
<!--获取当前仓库下的行-->
<select id="findPlaceXByDid" parameterType="int" resultType="int">
select DISTINCT x from place where did = #{did} and state != 3 ORDER BY x desc
</select>
<!--获取当前仓库下的列-->
<select id="findPlaceYByDid" parameterType="map" resultType="int">
select DISTINCT y from place where did = #{did} and x = #{x} and state != 3 ORDER BY y desc
</select>
<!--获取当前仓库下的ceng-->
<select id="findPlaceZByDid" parameterType="map" resultType="int">
select DISTINCT z from place where did = #{did} and x = #{x} and state != 3 ORDER BY z desc
</select>
</mapper>

143
target/classes/com/dreamchaser/depository_manage/mapper/QrCodeMapper.xml

@ -1,143 +0,0 @@
<?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">
<!-- 产品信息记录(库存)(material) -->
<mapper namespace="com.dreamchaser.depository_manage.mapper.QrCodeMapper">
<!-- This code was generated by TableGo tools, mark 1 begin. -->
<!-- 条形码与物料对应-->
<resultMap id="QrCodeAndLocationMap" type="com.dreamchaser.depository_manage.entity.PidOrDidAndCode">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="code" property="code" jdbcType="VARCHAR"/>
<result column="pid" property="pid" jdbcType="INTEGER"/>
<result column="flag" property="flag" jdbcType="INTEGER"/>
<result column="depositoryId" property="depositoryId" jdbcType="INTEGER"/>
</resultMap>
<!-- 表查询字段 -->
<sql id="allColumns">
pdac.id,pdac.code,pdac.pid,pdac.flag,pdac.depositoryId
</sql>
<select id="findLocationByCondition" resultType="map" resultMap="QrCodeAndLocationMap">
select
<include refid="allColumns"/>
from pidordidandcode pdac
where 1 = 1
<if test="id != null and id != ''">
and id = #{id}
</if>
<if test="pid != null">
and pid = #{pid}
</if>
<if test="depositoryId != null and depositoryId != ''">
and depositoryId = #{depositoryId}
</if>
<if test="flag != null and flag != ''">
and flag = #{flag}
</if>
<if test="qrCode != null and qrCode!=''">
and code = #{qrCode}
</if>
</select>
<insert id="addQrCodeAndMaterial" parameterType="map">
insert into qrcodeandmaterial(id,qrcode,mcode)
values (
#{id},
#{qrCode},
#{mcode}
)
</insert>
<insert id="addQrCodeAndMaterialForMoreOne" parameterType="map">
insert into qrcodeandmaterial(id,mcode,qrcode)
values
<foreach collection="list" index="index" item="item" separator=",">
(#{id},
#{code},
#{item})
</foreach>
</insert>
<select id="selectQrCodeByMcode" parameterType="string" resultType="string">
select qrcode
from qrcodeandmaterial
where mcode = #{mcode}
</select>
<select id="findMaterialCodeByQrCode" parameterType="string" resultType="string">
select mcode
from qrcodeandmaterial
where qrcode = #{qrcode}
</select>
<!-- 删除映射-->
<delete id="deleteQrCodeAndMaterial" parameterType="map">
delete
from qrcodeandmaterial
where 1 = 1
<if test="qrCode != null and qrCode != ''">
and qrcode = #{qrCode}
</if>
<if test="mcode != null and mcode != ''">
and mcode = #{mcode}
</if>
<if test="id != null and id != ''">
and id = #{id}
</if>
</delete>
<select id="selectQrCodeByDepositoryOrPlace" parameterType="map" resultType="string">
select code
from pidordidandcode
where 1 = 1
<if test="pid != null">
and pid = #{pid}
</if>
<if test="depositoryId != null and depositoryId != ''">
and depositoryId = #{depositoryId}
</if>
<if test="flag != null and flag != ''">
and flag = #{flag}
</if>
</select>
<insert id="addQrCodeByPidOrDid" parameterType="map">
insert into pidordidandcode(id,pid,depositoryId,flag,code)
values (
#{id},
#{pid},
#{depositoryId},
#{flag},
#{qrCode}
)
</insert>
<insert id="addQrCodeByPidOrDidForMoreOne" parameterType="map">
insert into pidordidandcode(id,pid,depositoryId,flag,code)
values
<foreach collection="list" index="index" item="item" separator=",">
( #{id},
#{pid},
#{depositoryId},
#{flag},
#{item})
</foreach>
</insert>
</mapper>

129
target/classes/com/dreamchaser/depository_manage/mapper/RoleMapper.xml

@ -1,129 +0,0 @@
<?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">
<!-- user -->
<mapper namespace="com.dreamchaser.depository_manage.mapper.RoleMapper">
<!-- 字段映射(权限) -->
<!-- 权限映射-->
<resultMap id="postoruserroleMap" type="com.dreamchaser.depository_manage.entity.PostOrUserRole">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="classes" property="classes" jdbcType="INTEGER" />
<result column="role" property="role" jdbcType="INTEGER" />
<result column="userid" property="userid" jdbcType="INTEGER" />
<result column="did" property="did" jdbcType="INTEGER" />
</resultMap>
<resultMap id="depositoryAndrole" type="com.dreamchaser.depository_manage.pojo.RoleAndDepository">
<result column="prid" property="id" jdbcType="INTEGER"/>
<result column="userId" property="userId" jdbcType="INTEGER"/>
<result column="depositoryName" property="depositoryName" jdbcType="VARCHAR"/>
<result column="depositoryAddress" property="depositoryAddress" jdbcType="VARCHAR"/>
<result column="depositoryIntroduce" property="depositoryIntroduce" jdbcType="VARCHAR"/>
<result column="depositoryState" property="depositoryState" jdbcType="VARCHAR"/>
<result column="did" property="depositoryId" jdbcType="VARCHAR"/>
<result column="depositoryCode" property="depositoryCode" jdbcType="VARCHAR"/>
<result column="classes" property="classes" jdbcType="INTEGER"/>
</resultMap>
<sql id="allColumns">
r.id,r.name
</sql>
<sql id="roleNameAnddepositoryName">
prid,userid as userId,dname as depositoryName,address as depositoryAddress ,introduce as depositoryIntroduce,state as depositoryState,did,classes,code as depositoryCode
</sql>
<update id="updateUserOrPostRoleAndDepository" parameterType="map">
update postoruserrole
<set>
<if test="authority != null and authority != ''">
role = #{authority},
</if>
<if test="depositoryId != null and depositoryId != ''">
did = #{depositoryId}
</if>
</set>
where userid = #{userid}
</update>
<update id="UpdateRoleAndDepositoryById" parameterType="map">
update postoruserrole
<set>
<if test="authority != null and authority != ''">
role = #{authority},
</if>
<if test="depositoryId != null and depositoryId != ''">
did = #{depositoryId},
</if>
<if test="classes != null and classes != ''">
classes = #{classes}
</if>
</set>
where id = #{roleId}
</update>
<insert id="addUserOrPostRoleAndDepository" parameterType="map">
INSERT INTO postoruserrole (
id, classes, role,userid,did
) VALUES (
#{id},
#{classes},
#{authority},
#{userid},
#{depositoryId}
)
</insert>
<select id="findDepositoryAndRole" parameterType="int" resultMap="depositoryAndrole">
select
<include refid="roleNameAnddepositoryName"/>
from userroleanddepository
where userid = #{userid}
</select>
<select id="findRoleByUid" parameterType="int" resultType="int">
select role from postoruserrole where userid = #{uid} and classes = 1
</select>
<select id="findUserIdByDid" parameterType="int" resultType="int">
select userid from postoruserrole where 1 = 1 and did = #{did}
</select>
<select id="findRoleAndDepositoryByCondition" parameterType="map" resultMap="depositoryAndrole">
select
<include refid="roleNameAnddepositoryName"/>
from userroleanddepository
where 1 = 1
<if test="depositoryId != null and depositoryId != ''">
and did = #{depositoryId}
</if>
<if test="userId != null and userId != ''">
and userId = #{userId}
</if>
<if test="classes != null and classes != ''">
and classes = #{classes}
</if>
</select>
<select id="findRoleAndDepositoryById" parameterType="int" resultMap="depositoryAndrole">
select
<include refid="roleNameAnddepositoryName"/>
from userroleanddepository
where prid = #{id}
</select>
<delete id="deleteRoleAndDepositoryById" parameterType="int">
delete from postoruserrole WHERE id = #{id}
</delete>
</mapper>

329
target/classes/com/dreamchaser/depository_manage/mapper/StockTakingMapper.xml

@ -1,329 +0,0 @@
<?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">
<!-- notice -->
<mapper namespace="com.dreamchaser.depository_manage.mapper.StockTakingMapper">
<!-- This code was generated by TableGo tools, mark 1 begin. -->
<!-- 字段映射 -->
<resultMap id="StockTakingMap" type="com.dreamchaser.depository_manage.entity.StockTaking">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="code" property="code" jdbcType="VARCHAR" />
<result column="depositoryId" property="depositoryId" jdbcType="INTEGER" />
<result column="placeId" property="placeId" jdbcType="INTEGER" />
<result column="state" property="state" jdbcType="INTEGER" />
<result column="departmentManagerState" property="departmentManagerState" jdbcType="INTEGER" />
<result column="crateTime" property="crateTime" jdbcType="INTEGER" />
<result column="completeTime" property="completeTime" jdbcType="INTEGER" />
<result column="reviewTime" property="reviewTime" jdbcType="INTEGER" />
<result column="originator" property="originator" jdbcType="INTEGER" />
<result column="departmentManager" property="departmentManager" jdbcType="VARCHAR" />
<result column="auditOpinion" property="auditOpinion" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="StockTakingChildMap" type="com.dreamchaser.depository_manage.pojo.StockTakingChildP">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="mid" property="mid" jdbcType="INTEGER" />
<result column="oldInventory" property="oldInventory" jdbcType="INTEGER" />
<result column="newInventory" property="newInventory" jdbcType="INTEGER" />
<result column="inventory" property="inventory" jdbcType="INTEGER" />
<result column="mainId" property="mainId" jdbcType="INTEGER" />
<result column="takingResult" property="takingResult" jdbcType="VARCHAR" />
<result column="mtexture" property="mtexture" jdbcType="VARCHAR" />
<result column="mversion" property="mversion" jdbcType="VARCHAR" />
<result column="munit" property="munit" jdbcType="VARCHAR" />
<result column="tname" property="tname" jdbcType="VARCHAR" />
<result column="mcode" property="mcode" jdbcType="VARCHAR" />
<result column="mname" property="mname" jdbcType="VARCHAR" />
<result column="mtId" property="mtId" jdbcType="INTEGER" />
<result column="producedDate" property="producedDate" jdbcType="INTEGER" />
</resultMap>
<!-- 表查询字段 -->
<sql id="StockTakingAllColumns">
st.id,st.code,st.depositoryId,st.placeId,st.departmentManager,st.state,st.createTime,st.originator,st.completeTime,st.reviewTime,st.auditOpinion,st.departmentManagerState
</sql>
<sql id="StockTakingChildPAllColumns">
id,mid,oldInventory,newInventory,inventory,mainId,takingResult,mname,mtId,tname,mcode,mversion,munit,mtexture,producedDate
</sql>
<!-- 插入主表-->
<insert id="insertStockTaking" useGeneratedKeys="true" keyProperty="id">
INSERT INTO stocktaking (id,code,depositoryId,placeId,departmentManager,state,createTime,originator,departmentManagerState)
values (
#{id},
#{code},
#{depositoryId},
#{placeId},
#{departmentManager},
#{state},
#{createTime},
#{originator},
#{departmentManagerState}
)
</insert>
<!-- 插入子表-->
<insert id="insertStockTakingChild" useGeneratedKeys="true" keyProperty="id">
INSERT INTO stocktakingchild (id,mid,oldInventory,newInventory,takingResult,inventory,mainId,producedDate)
values (
#{id},#{mid},#{oldInventory},#{newInventory},#{takingResult},#{inventory},#{mainId},#{producedDate}
)
</insert>
<delete id="deleteStockTakingChild" parameterType="int">
delete from stocktakingchild where id = #{id}
</delete>
<delete id="deleteStockTakingChilds" parameterType="list">
delete from stocktakingchild
where id in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteStockTaking" parameterType="int">
delete from stocktaking where id = #{id}
</delete>
<delete id="deleteStockTakings" parameterType="list">
delete from stocktaking
where id in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="updateStockTaking">
update stocktaking
<set>
<if test="code != null and code != ''">
code = #{code},
</if>
<if test="depositoryId != null">
depositoryId = #{depositoryId},
</if>
<if test="placeId != null">
placeId = #{placeId},
</if>
<if test="departmentManager != null and departmentManager != ''">
departmentManager = #{departmentManager},
</if>
<if test="state != null and state != ''">
state = #{state},
</if>
<if test="departmentManagerState != null and departmentManagerState != ''">
departmentManagerState = #{departmentManagerState},
</if>
<if test="createTime != null and createTime != ''">
createTime = #{createTime},
</if>
<if test="originator != null and originator!=''">
originator = #{originator},
</if>
<if test="auditOpinion != null">
auditOpinion = #{auditOpinion},
</if>
<if test="completeTime != null and completeTime != ''">
completeTime = #{completeTime},
</if>
<if test="reviewTime != null and reviewTime != ''">
reviewTime = #{reviewTime}
</if>
</set>
where id = #{id}
</update>
<update id="updateStockTakingChild">
update stocktakingchild
<set>
<if test="mid != null and mid != ''">
mid = #{mid},
</if>
<if test="oldInventory != null">
oldInventory = #{oldInventory},
</if>
<if test="newInventory != null">
newInventory = #{newInventory},
</if>
<if test="takingResult != null and takingResult != ''">
takingResult = #{takingResult},
</if>
<if test="inventory != null">
inventory = #{inventory},
</if>
<if test="mainId != null and mainId != ''">
mainId = #{mainId},
</if>
<if test="producedDate != null and producedDate != ''">
producedDate = #{producedDate}
</if>
</set>
where id = #{id}
</update>
<select id="selectStockTakingChildByMainId" parameterType="int" resultMap="StockTakingChildMap">
select
<include refid="StockTakingChildPAllColumns"/>
from stocktakingchildinfo
where mainId = #{mainId}
</select>
<select id="selectStockTakingChildByIds" parameterType="list" resultMap="StockTakingChildMap">
select
<include refid="StockTakingChildPAllColumns"/>
from stocktakingchildinfo
where id in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="selectStockTakingByCondition" parameterType="map" resultMap="StockTakingMap">
select
<include refid="StockTakingAllColumns"/>
from stocktaking st
where 1 = 1
<if test="code != null and code != ''">
and st.code LIKE CONCAT('%', #{code}, '%')
</if>
<if test="depositoryId != null and depositoryId != ''">
and st.depositoryId = #{depositoryId}
</if>
<if test="placeId != null">
and st.placeId = #{placeId}
</if>
<if test="departmentManagerState != null and departmentManagerState != ''">
and st.departmentManagerState = #{departmentManagerState}
</if>
<if test="departmentManager != null and departmentManager != ''">
and FIND_IN_SET(#{departmentManager},st.departmentManager) != 0
</if>
<if test="originator != null and originator!=''">
and st.originator = #{originator}
</if>
</select>
<select id="selectStockTakingChildPByCondition" parameterType="map" resultMap="StockTakingChildMap">
select
<include refid="StockTakingChildPAllColumns"/>
from stocktakingchildinfo
where 1 = 1
<if test="mid != null and mid != ''">
and mid = #{mid}
</if>
<if test="oldInventory != null">
and oldInventory = #{oldInventory}
</if>
<if test="newInventory != null">
and newInventory = #{newInventory}
</if>
<if test="takingResult != null and takingResult != ''">
and takingResult = #{takingResult}
</if>
<if test="inventory != null">
and inventory = #{inventory}
</if>
<if test="mainId != null and mainId != ''">
and mainId = #{mainId}
</if>
<if test="mname != null and mname != ''">
and mname like CONCAT('%',#{mname},'%')
</if>
<if test="mtId != null">
and mtId = #{mtId}
</if>
<if test="mcode != null and mcode != ''">
and mcode = #{mcode}
</if>
<if test="mversion != null and mversion != ''">
and mversion = #{mversion}
</if>
<if test="munit != null and munit != ''">
and munit = #{munit}
</if>
<if test="mtexture != null and mtexture != ''">
and mtexture = #{mtexture}
</if>
<if test="producedDate != null">
and producedDate = #{producedDate}
</if>
</select>
<select id="selectStockTakingById" resultMap="StockTakingMap">
select
<include refid="StockTakingAllColumns"/>
from stocktaking st
where st.id = #{id}
</select>
<select id="selectStockTakingChildPById" resultMap="StockTakingChildMap">
select
<include refid="StockTakingChildPAllColumns"/>
from stocktakingchildinfo
where id = #{id}
</select>
<select id="findMyTask" parameterType="map" resultMap="StockTakingMap">
select
<include refid="StockTakingAllColumns"/>
from stocktaking st
where 1 = 1
<if test='isDone == "0"'>
and (state = 3 and departmentManagerState = 3 and FIND_IN_SET(#{userId},st.departmentManager) != 0 )
or (state = 3 and departmentManagerState != 3 and #{userId} = st.originator)
</if>
<if test='isDone == "1"'>
and (state != 3 and departmentManagerState != 3 and FIND_IN_SET(#{userId},st.departmentManager) != 0 )
or (state != 3 and departmentManagerState != 3 and #{userId} = st.originator)
</if>
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
</select>
<select id="findMyTaskCount" parameterType="map" resultType="int">
SELECT
count(*)
from stocktaking st
where 1 = 1
<if test='isDone == "0"'>
and (state = 3 and departmentManagerState = 3 and FIND_IN_SET(#{userId},st.departmentManager) != 0 )
or (state = 3 and departmentManagerState != 3 and #{userId} = st.originator)
</if>
<if test='isDone == "1"'>
and (state != 3 and departmentManagerState != 3 and FIND_IN_SET(#{userId},st.departmentManager) != 0 )
or (state != 3 and departmentManagerState != 3 and #{userId} = st.originator)
</if>
</select>
<select id="findMyApply" parameterType="map" resultMap="StockTakingMap">
select
<include refid="StockTakingAllColumns"/>
from stocktaking st
where 1 = 1
and originator = #{userId}
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
</select>
<select id="findMyApplyCount" parameterType="map" resultType="int">
SELECT
count(*)
from stocktaking st
where 1 = 1
and originator = #{userId}
</select>
</mapper>

153
target/classes/com/dreamchaser/depository_manage/mapper/TransferRecordMapper.xml

@ -1,153 +0,0 @@
<?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">
<!-- transfer_record -->
<mapper namespace="com.dreamchaser.depository_manage.mapper.TransferRecordMapper">
<!-- This code was generated by TableGo tools, mark 1 begin. -->
<!-- 字段映射 -->
<resultMap id="transferRecordMap" type="com.dreamchaser.depository_manage.entity.TransferRecord">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="from_id" property="fromId" jdbcType="INTEGER" />
<result column="to_id" property="toId" jdbcType="INTEGER" />
<result column="mid" property="mid" jdbcType="INTEGER" />
<result column="applicantTime" property="applicantTime" jdbcType="INTEGER" />
<result column="applicantId" property="applicantId" jdbcType="INTEGER" />
<result column="from_place_id" property="fromPlaceId" jdbcType="INTEGER" />
<result column="to_place_id" property="toPlaceId" jdbcType="INTEGER" />
</resultMap>
<!-- 表查询字段 -->
<sql id="allColumns">
tr.id, tr.from_id, tr.to_id,tr.mid,tr.applicantTime,tr.applicantId,tr.from_place_id,tr.to_place_id
</sql>
<!-- 查询所有
<select id="findTransferRecordAll" resultMap="transferRecordMap">
SELECT
<include refid="allColumns" />
FROM transfer_record tr
</select>-->
<!-- 根据条件参数查询列表-->
<select id="findTransferRecordByCondition" resultMap="transferRecordMap" parameterType="map">
SELECT
<include refid="allColumns" />
FROM transfer_record tr WHERE 1 = 1
<if test="fromId != null">
AND tr.from_id = #{fromId}
</if>
<if test="toId != null">
AND tr.to_id = #{toId}
</if>
<if test="mid != null">
and tr.mid = #{mid}
</if>
<if test="applicantTime != null">
and tr.applicantTime = #{applicantTime}
</if>
<if test="applicantId != null">
and tr.applicantId = #{applicantId}
</if>
<if test="fromPlaceId != null">
and tr.from_place_id = #{fromPlaceId}
</if>
<if test="toPlaceId != null">
and tr.to_place_id = #{toPlaceId}
</if>
</select>
<!-- 根据主键查询信息
<select id="findTransferRecordByIds" resultMap="transferRecordMap" parameterType="list">
SELECT
<include refid="allColumns" />
FROM transfer_record tr WHERE tr.id IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>-->
<select id="findTransferRecordById" resultMap="transferRecordMap" parameterType="int">
SELECT
<include refid="allColumns" />
FROM transfer_record tr WHERE tr.id = #{id}
</select>
<!-- 新增信息 -->
<insert id="addTransferRecord" parameterType="map" useGeneratedKeys="true" keyProperty="id">
INSERT INTO transfer_record (
id, from_id, to_id,quantity,mid,applicantTime,applicantId,from_place_id,to_place_id
) VALUES (
#{id},
#{fromId},
#{toId},
#{quantity},
#{mid},
#{applicantTime},
#{applicantId},
#{fromPlaceId},
#{toPlaceId}
)
</insert>
<!-- 批量新增信息
<insert id="addTransferRecords" parameterType="list">
INSERT INTO transfer_record (
id, from_id, to_id
) VALUES
<foreach collection="list" index="index" item="item" separator=",">
(
#{item.id},
#{item.fromId},
#{item.toId}
)
</foreach>
</insert>-->
<!-- 修改信息
<update id="updateTransferRecord">
UPDATE transfer_record
<set>
<if test="fromId != null">
from_id = #{fromId},
</if>
<if test="toId != null">
to_id = #{toId}
</if>
</set>
WHERE id = #{id}
</update>-->
<!-- 批量修改信息
<update id="updateTransferRecords" parameterType="list">
<foreach collection="list" index="index" item="item" separator=";">
UPDATE transfer_record
<set>
<if test="item.fromId != null">
from_id = #{item.fromId},
</if>
<if test="item.toId != null">
to_id = #{item.toId}
</if>
</set>
WHERE id = #{item.id}
</foreach>
</update>-->
<!-- 根据主键删除
<delete id="deleteTransferRecordById" parameterType="int">
DELETE FROM transfer_record WHERE id = #{id}
</delete>-->
<!-- 根据主键批量删除
<delete id="deleteTransferRecordByIds" parameterType="list">
DELETE FROM transfer_record WHERE id IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>-->
</mapper>

381
target/classes/com/dreamchaser/depository_manage/mapper/UserMapper.xml

@ -1,381 +0,0 @@
<?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">
<!-- user -->
<mapper namespace="com.dreamchaser.depository_manage.mapper.UserMapper">
<!-- 字段映射 -->
<resultMap id="userMap" type="com.dreamchaser.depository_manage.entity.User">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="uname" property="uname" jdbcType="VARCHAR" />
<result column="authority" property="authority" jdbcType="VARCHAR" />
<result column="pwd" property="pwd" jdbcType="VARCHAR" />
<result column="sex" property="sex" jdbcType="VARCHAR" />
<result column="depository_id" property="depositoryId" jdbcType="INTEGER" />
<result column="entry_date" property="entryDate" jdbcType="TIMESTAMP" />
<result column="email" property="email" jdbcType="VARCHAR" />
<result column="phone" property="phone" jdbcType="VARCHAR" />
<result column="state" property="state" javaType="INTEGER"/>
</resultMap>
<!-- 字段映射(包括角色名)-->
<resultMap id="userMapWithRoleName" type="com.dreamchaser.depository_manage.entity.User">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="state" property="state" javaType="INTEGER"/>
<result column="uname" property="uname" jdbcType="VARCHAR" />
<result column="authority" property="authority" jdbcType="VARCHAR" />
<result column="pwd" property="pwd" jdbcType="VARCHAR" />
<result column="sex" property="sex" jdbcType="VARCHAR" />
<result column="depository_id" property="depositoryId" jdbcType="INTEGER" />
<result column="entry_date" property="entryDate" jdbcType="TIMESTAMP" />
<result column="email" property="email" jdbcType="VARCHAR" />
<result column="phone" property="phone" jdbcType="VARCHAR" />
<association property="role" javaType="com.dreamchaser.depository_manage.entity.Role">
<id property="id" column="authority"/>
<result property="name" column="name"/>
</association>
</resultMap>
<!-- 表查询字段(不敏感信息) -->
<sql id="noSensitiveColumns">
u.id, u.uname, u.sex, u.entry_date
</sql>
<!-- 表查询字段 -->
<sql id="allColumns">
u.id, u.uname, u.authority, u.pwd, u.sex, u.depository_id, u.entry_date, u.email,
u.phone,u.state
</sql>
<sql id="ColumnsAndRoleName">
u.id, u.uname,u.authority, u.pwd, u.sex, u.depository_id, u.entry_date, u.email,
u.phone,u.state
</sql>
<!-- This code was generated by TableGo tools, mark 2 end. -->
<!-- 查询该表的行数 -->
<select id="findCount" resultType="integer">
SELECT
count(*)
FROM user u
</select>
<!-- 根据条件查询数据的数量 -->
<select id="findCountByCondition" resultType="integer" parameterType="map">
SELECT
count(*)
FROM user u WHERE 1 = 1
<if test="uname != null and uname != ''">
AND u.uname LIKE CONCAT('%', #{uname}, '%')
</if>
<if test="authority != null and authority != ''">
AND u.authority LIKE CONCAT('%', #{authority}, '%')
</if>
<if test="pwd != null and pwd != ''">
AND u.pwd LIKE CONCAT('%', #{pwd}, '%')
</if>
<if test="sex != null and sex != ''">
AND u.sex LIKE CONCAT('%', #{sex}, '%')
</if>
<if test="depositoryId != null">
AND u.depository_id = #{depositoryId}
</if>
<if test="entryDate != null">
AND u.entry_date = #{entryDate}
</if>
<if test="email != null and email != ''">
AND u.email LIKE CONCAT('%', #{email}, '%')
</if>
<if test="phone != null and phone != ''">
AND u.phone LIKE CONCAT('%', #{phone}, '%')
</if>
<if test="state != null and state != ''">
and u.state = #{state}
</if>
and u.state != 3
</select>
<!-- 查询所有数据 -->
<!-- <select id="findUserAll" resultMap="userMap">
SELECT
<include refid="allColumns" />
FROM user u
</select>-->
<!-- 根据id查询数据列表 -->
<select id="findUserNameById" resultType="string" parameterType="int">
SELECT
u.uname
FROM user u WHERE u.id=#{id}
</select>
<!-- 根据email查询数据列表 -->
<select id="findUserByEmail" resultMap="userMap" parameterType="string">
SELECT
<include refid="allColumns" />
FROM user u WHERE u.email LIKE CONCAT('%', #{email}, '%')
</select>
<!-- 根据条件参数查询数据列表 -->
<select id="findUsersByCondition" resultMap="userMapWithRoleName" parameterType="map">
SELECT
<include refid="ColumnsAndRoleName" />
FROM user u WHERE 1 = 1
<if test="uname != null and uname != ''">
AND u.uname LIKE CONCAT('%', #{uname}, '%')
</if>
<if test="authority != null and authority != ''">
AND u.authority = #{authority}
</if>
<if test="pwd != null and pwd != ''">
AND u.pwd LIKE CONCAT('%', #{pwd}, '%')
</if>
<if test="sex != null and sex != ''">
AND u.sex LIKE CONCAT('%', #{sex}, '%')
</if>
<if test="depositoryId != null">
AND u.depository_id = #{depositoryId} or u.depository_id = 0
</if>
<if test="entryDate != null">
AND u.entry_date = #{entryDate}
</if>
<if test="email != null and email != ''">
AND u.email LIKE CONCAT('%', #{email}, '%')
</if>
<if test="phone != null and phone != ''">
AND u.phone LIKE CONCAT('%', #{phone}, '%')
</if>
<if test="state != null and state != ''">
And u.state = #{state}
</if>
and u.state != 3
<if test="begin != null and size != null">
LIMIT #{begin},#{size}
</if>
</select>
<!-- 根据条件参数查询数据列表 -->
<select id="findUserByCondition" resultMap="userMap" parameterType="map">
SELECT
<include refid="allColumns" />
FROM user u WHERE 1 = 1
<if test="uname != null and uname != ''">
AND u.uname LIKE CONCAT('%', #{uname}, '%')
</if>
<if test="authority != null and authority != ''">
AND u.authority LIKE CONCAT('%', #{authority}, '%')
</if>
<if test="pwd != null and pwd != ''">
AND u.pwd LIKE CONCAT('%', #{pwd}, '%')
</if>
<if test="sex != null and sex != ''">
AND u.sex LIKE CONCAT('%', #{sex}, '%')
</if>
<if test="depositoryId != null">
AND u.depository_id = #{depositoryId}
</if>
<if test="entryDate != null">
AND u.entry_date = #{entryDate}
</if>
<if test="email != null and email != ''">
AND u.email LIKE CONCAT('%', #{email}, '%')
</if>
<if test="phone != null and phone != ''">
AND u.phone LIKE CONCAT('%', #{phone}, '%')
</if>
<if test="state != null and state != ''">
and u.state = #{state}
</if>
and u.state != 3
</select>
<!-- 根据主键查询数据 -->
<select id="findUserById" resultMap="userMap" parameterType="integer">
SELECT
<include refid="allColumns" />
FROM user u WHERE u.id = #{id}
</select>
<!-- 根据主键查询数据
<select id="findUserByIds" resultMap="userMap" parameterType="list">
SELECT
<include refid="allColumns" />
FROM user u WHERE u.id IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>-->
<!-- 插入数据 -->
<insert id="insertUser" parameterType="map">
INSERT INTO user (
id, uname, authority, pwd, sex, depository_id, entry_date, email,
phone
) VALUES (
#{id},
#{uname},
#{authority},
#{pwd},
#{sex},
#{depositoryId},
#{entryDate},
#{email},
#{phone}
)
</insert>
<!-- 批量插入数据
<insert id="insertUsers" parameterType="list">
INSERT INTO user (
id, uname, authority, pwd, sex, depository_id, entry_date, email,
phone
) VALUES
<foreach collection="list" index="index" item="item" separator=",">
(
#{item.id},
#{item.uname},
#{item.authority},
#{item.pwd},
#{item.sex},
#{item.depositoryId},
#{item.entryDate},
#{item.email},
#{item.phone}
)
</foreach>
</insert>-->
<!-- 修改不敏感数据(这里由于并未对手机号进行验证所以这个也是非敏感信息可以给用户自己修改) -->
<update id="updateUserNoSensitive" parameterType="map">
UPDATE user
<set>
<if test='uname != null and uname!=""'>
uname = #{uname},
</if>
<if test='sex != null and sex!=""'>
sex = #{sex},
</if>
<if test="entryDate != null and entryDate!=''">
entry_date = #{entryDate},
</if>
<if test="phone != null and phone !=''">
phone = #{phone}
</if>
</set>
WHERE id = #{id}
</update>
<!-- 修改数据 -->
<update id="updateUser" parameterType="map">
UPDATE user
<set>
<if test='uname != null and uname!=""'>
uname = #{uname},
</if>
<if test='authority != null and authority!=""'>
authority = #{authority},
</if>
<if test="pwd != null and pwd!=''">
pwd = #{pwd},
</if>
<if test='sex != null and sex!=""'>
sex = #{sex},
</if>
<if test="depositoryId != null and depository!=''">
depository_id = #{depositoryId},
</if>
<if test="entryDate != null and entryDate!=''">
entry_date = #{entryDate},
</if>
<if test="email != null and email != ''">
email = #{email},
</if>
<if test="phone != null and phone !=''">
phone = #{phone},
</if>
<if test="state != null and state != ''">
state = #{state}
</if>
</set>
WHERE id = #{id}
</update>
<!-- 批量修改数据
<update id="updateUsers" parameterType="list">
<foreach collection="list" index="index" item="item" separator=";">
UPDATE user
<set>
<if test="item.uname != null">
uname = #{item.uname},
</if>
<if test="item.authority != null">
authority = #{item.authority},
</if>
<if test="item.pwd != null">
pwd = #{item.pwd},
</if>
<if test="item.sex != null">
sex = #{item.sex},
</if>
<if test="item.depositoryId != null">
depository_id = #{item.depositoryId},
</if>
<if test="item.entryDate != null">
entry_date = #{item.entryDate},
</if>
<if test="item.email != null">
email = #{item.email},
</if>
<if test="item.phone != null">
phone = #{item.phone}
</if>
</set>
WHERE id = #{item.id}
</foreach>
</update>-->
<!-- 根据主键删除数据 -->
<delete id="deleteUserById" parameterType="integer">
DELETE FROM user WHERE id = #{id}
</delete>
<!-- 根据主键批量删除数据 -->
<delete id="deleteUserByIds" parameterType="list">
DELETE FROM user WHERE id IN
<!-- 单参数时,List对象只能为list,数组对象只能为array,多参数用map时,collection参数才为KeyName -->
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<!--根据主键将状态修改为删除-->
<update id="changeUserStateToDeleteById" parameterType="integer">
update user
<set>
state = 3
</set>
where id = #{id}
</update>
<!--根据主键批量将状态修改为删除-->
<update id="changeUserStateToDeleteByIds" parameterType="list">
update user
<set>
state = 3
</set>
where id in
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="updateUserPasswordById" parameterType="map">
update user
<set>
pwd = #{new_password}
</set>
where id = #{id}
</update>
<select id="FindDepositoryByUserId" parameterType="int" resultType="string">
select dname from depositoryanduserbyport where uid = #{id}
</select>
</mapper>

143
target/classes/com/dreamchaser/depository_manage/mapper/standingBookMapper.xml

@ -1,143 +0,0 @@
<?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">
<!-- standing_book -->
<mapper namespace="mysql.standingBook">
<!-- This code was generated by TableGo tools, mark 1 begin. -->
<!-- 字段映射 -->
<resultMap id="standingBookMap" type="StandingBook">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="INTEGER" />
<result column="quantity" property="quantity" jdbcType="INTEGER" />
<result column="price" property="price" jdbcType="INTEGER" />
<result column="material_name" property="materialName" jdbcType="VARCHAR" />
</resultMap>
<!-- This code was generated by TableGo tools, mark 1 end. -->
<!-- This code was generated by TableGo tools, mark 2 begin. -->
<!-- 表查询字段 -->
<sql id="allColumns">
sb.id, sb.type, sb.quantity, sb.price, sb.material_name
</sql>
<!-- This code was generated by TableGo tools, mark 2 end. -->
<!-- 查询所有数据 -->
<select id="findStandingBookAll" resultMap="standingBookMap">
SELECT
<include refid="allColumns" />
FROM standing_book sb
</select>
<!-- 根据条件参数查询数据列表 -->
<select id="findStandingBookByCondition" resultMap="standingBookMap" parameterType="map">
SELECT
<include refid="allColumns" />
FROM standing_book sb WHERE 1 = 1
<if test="type != null">
AND sb.type = #{type}
</if>
<if test="quantity != null">
AND sb.quantity = #{quantity}
</if>
<if test="price != null">
AND sb.price = #{price}
</if>
<if test="materialName != null and materialName != ''">
AND sb.material_name LIKE CONCAT('%', #{materialName}, '%')
</if>
</select>
<!-- 根据主键查询数据 -->
<select id="findStandingBookByIds" resultMap="standingBookMap" parameterType="list">
SELECT
<include refid="allColumns" />
FROM standing_book sb WHERE sb.id IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<!-- 插入数据 -->
<insert id="insertStandingBook" parameterType="map">
INSERT INTO standing_book (
id, type, quantity, price, material_name
) VALUES (
#{id},
#{type},
#{quantity},
#{price},
#{materialName}
)
</insert>
<!-- 批量插入数据 -->
<insert id="insertStandingBooks" parameterType="list">
INSERT INTO standing_book (
id, type, quantity, price, material_name
) VALUES
<foreach collection="list" index="index" item="item" separator=",">
(
#{item.id},
#{item.type},
#{item.quantity},
#{item.price},
#{item.materialName}
)
</foreach>
</insert>
<!-- 修改数据 -->
<update id="updateStandingBook" parameterType="map">
UPDATE standing_book
<set>
<if test="type != null">
type = #{type},
</if>
<if test="quantity != null">
quantity = #{quantity},
</if>
<if test="price != null">
price = #{price},
</if>
<if test="materialName != null">
material_name = #{materialName}
</if>
</set>
WHERE id = #{id}
</update>
<!-- 批量修改数据 -->
<update id="updateStandingBooks" parameterType="list">
<foreach collection="list" index="index" item="item" separator=";">
UPDATE standing_book
<set>
<if test="item.type != null">
type = #{item.type},
</if>
<if test="item.quantity != null">
quantity = #{item.quantity},
</if>
<if test="item.price != null">
price = #{item.price},
</if>
<if test="item.materialName != null">
material_name = #{item.materialName}
</if>
</set>
WHERE id = #{item.id}
</foreach>
</update>
<!-- 根据主键删除数据 -->
<delete id="deleteStandingBookById" parameterType="int">
DELETE FROM standing_book WHERE id = #{id}
</delete>
<!-- 根据主键批量删除数据 -->
<delete id="deleteStandingBookByIds" parameterType="list">
DELETE FROM standing_book WHERE id IN
<foreach collection="list" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

155
target/classes/logback-spring.xml

@ -1,155 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<!-- 应用名称-->
<property name="appName" value="Dreamchser"/>
<!-- 日志的存放目录-->
<!-- debug-->
<property name="DEBUG_LOG_FILE_NAME_PATTERN" value="logs/${appName}-debug.%d{yyyy-MM-dd}.%i.log"/>
<property name="INFO_LOG_FILE_NAME_PATTERN" value="logs/${appName}-info.%d{yyyy-MM-dd}.%i.log"/>
<property name="WARN_LOG_FILE_NAME_PATTERN" value="errlogs/${appName}-warn.%d{yyyy-MM-dd}.%i.log"/>
<property name="ERROR_LOG_FILE_NAME_PATTERN" value="errlogs/${appName}-error.%d{yyyy-MM-dd}.%i.log"/>
<!-- 日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%c){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
<property name="FILE_LOG_PATTERN"
value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %c : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
<!--输出到控制台-->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<!--输出到DEBUG文件-->
<appender name="debug_file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${DEBUG_LOG_FILE_NAME_PATTERN}</fileNamePattern>
<!-- 日志保留天数 -->
<maxHistory>30</maxHistory>
<!-- 日志文件上限大小,达到指定大小后删除旧的日志文件 -->
<totalSizeCap>2GB</totalSizeCap>
<!-- 每个日志文件的最大值 -->
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>50MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
<!-- 此日志文件只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!--输出到INFO文件-->
<appender name="info_file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${INFO_LOG_FILE_NAME_PATTERN}</fileNamePattern>
<!-- 日志保留天数 -->
<maxHistory>7</maxHistory>
<!-- 日志文件上限大小,达到指定大小后删除旧的日志文件 -->
<totalSizeCap>1GB</totalSizeCap>
<!-- 每个日志文件的最大值 -->
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>50MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
<!-- 此日志文件只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!--输出到WARN文件-->
<appender name="warn_file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${WARN_LOG_FILE_NAME_PATTERN}</fileNamePattern>
<!-- 日志保留天数 -->
<maxHistory>30</maxHistory>
<!-- 日志文件上限大小,达到指定大小后删除旧的日志文件 -->
<totalSizeCap>1GB</totalSizeCap>
<!-- 每个日志文件的最大值 -->
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
<!-- 此日志文件只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!--输出到ERROR文件-->
<appender name="error_file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${ERROR_LOG_FILE_NAME_PATTERN}</fileNamePattern>
<!-- 日志保留天数 -->
<maxHistory>30</maxHistory>
<!-- 日志文件上限大小,达到指定大小后删除旧的日志文件 -->
<totalSizeCap>1GB</totalSizeCap>
<!-- 每个日志文件的最大值 -->
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>${FILE_LOG_PATTERN}</pattern>
</encoder>
<!-- 此日志文件只记录error级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>error</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- region 根据不同的环境设置不同的日志输出级别 -->
<springProfile name="default,local,dev">
<root level="info">
<appender-ref ref="console"/>
</root>
<!-- <logger name="com.dreamchaser" level="debug"/>-->
</springProfile>
<springProfile name="prod,pre,test">
<root level="info">
<appender-ref ref="console"/>
<appender-ref ref="debug_file"/>
<appender-ref ref="info_file"/>
<appender-ref ref="warn_file"/>
<appender-ref ref="error_file"/>
</root>
<logger name="com.ibatis" level="DEBUG" />
<logger name="com.ibatis.common.jdbc.SimpleDataSource" level="DEBUG" />
<logger name="com.ibatis.common.jdbc.ScriptRunner" level="DEBUG" />
<logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="DEBUG" />
<logger name="java.sql.Connection" level="DEBUG" />
<logger name="java.sql.Statement" level="DEBUG" />
<logger name="java.sql.PreparedStatement" level="DEBUG" />
<logger name="java.sql.ResultSet" level="DEBUG" />
<logger name="com.dreamchaser.dream.depository_manage.mapper" level="DEBUG" />
<!-- <logger name="com.dreamchaser.mapper" level="debug"/>-->
</springProfile>
<!-- endregion -->
</configuration>

26
target/classes/redisson-config.yml

@ -1,26 +0,0 @@
#Redisson配置
singleServerConfig:
address: "redis://127.0.0.1:6379"
clientName: null
database: 7 #选择使用哪个数据库0~15
idleConnectionTimeout: 10000
pingTimeout: 1000
connectTimeout: 10000
timeout: 3000
retryAttempts: 3
retryInterval: 1500
reconnectionTimeout: 3000
failedAttempts: 3
subscriptionsPerConnection: 5
subscriptionConnectionMinimumIdleSize: 1
subscriptionConnectionPoolSize: 50
connectionMinimumIdleSize: 32
connectionPoolSize: 64
dnsMonitoringInterval: 5000
#dnsMonitoring: false
threads: 0
nettyThreads: 0
codec:
class: "org.redisson.codec.JsonJacksonCodec"
transportMode: "NIO"

4
target/classes/static/api/clear.json

@ -1,4 +0,0 @@
{
"code": 1,
"msg": "服务端清理缓存成功"
}

226
target/classes/static/api/init.json

@ -1,226 +0,0 @@
{
"homeInfo": {
"title": "首页",
"href": "/welcome"
},
"logoInfo": {
"title": "Repository",
"image": "static/images/logo.png",
"href": ""
},
"menuInfo": [
{
"title": "仓库信息概览",
"href": "/welcome",
"icon": "fa fa-tachometer",
"target": "_self",
"child": [
{
"title": "首页",
"href": "/welcome",
"icon": "fa fa-home",
"target": "_self"
}
]
},
{
"title": "仓库管理",
"icon": "fa fa-lemon-o",
"href": "",
"target": "_self",
"child": [
{
"title": "申请提交",
"icon": "fa fa-book",
"target": "_self",
"child": [
{
"title": "入库申请",
"href": "/application_in",
"icon": "layui-icon layui-icon-file-b",
"target": "_self"
},
{
"title": "出库申请",
"href": "/application_out",
"icon": "fa fa-file-text",
"target": "_self"
},
{
"title": "库存转移申请",
"href": "/application_transfer",
"icon": "fa fa-exchange",
"target": "_self"
}
]
},
{
"title": "入库管理",
"icon": "fa fa-mail-forward",
"target": "_self",
"child": [
{
"title": "入库查询",
"href": "/table_in",
"icon": "fa fa-th-list",
"target": "_self"
},
{
"title": "入库可视化",
"href": "/chart_in",
"icon": "fa fa-bar-chart",
"target": "_self"
},
{
"title": "入库可视化(测试)",
"href": "/chart_in_back",
"icon": "fa fa-bar-chart",
"target": "_self"
}
]
},
{
"title": "出库管理",
"icon": "fa fa-mail-reply",
"target": "_self",
"child": [
{
"title": "出库查询",
"href": "/table_out",
"icon": "fa fa-th-list",
"target": "_self"
},
{
"title": "出库可视化",
"href": "/chart_out",
"icon": "fa fa-pie-chart",
"target": "_self"
}
]
},
{
"title": "库存管理",
"icon": "fa fa-server",
"target": "_self",
"child": [
{
"title": "库存查询",
"href": "/table_stock",
"icon": "fa fa-th-list",
"target": "_self"
},
{
"title": "库存可视化",
"href": "/chart_stock",
"icon": "fa fa-area-chart",
"target": "_self"
}
]
},
{
"title": "仓库管理",
"icon": "fa fa-wrench",
"target": "_self",
"child": [
{
"title": "创建仓库",
"href": "/depository_add",
"icon": "layui-icon layui-icon-template-1",
"target": "_self"
},
{
"title": "仓库查询",
"href": "/depository-out",
"icon": "fa fa-th-list",
"target": "_self"
}
]
},
{
"title": "物料种类管理",
"icon": "fa fa-wrench",
"target": "_self",
"child": [
{
"title": "物料种类添加",
"href": "/materialType_add",
"icon": "layui-icon layui-icon-list",
"target": "_self"
},
{
"title": "物料种类查询",
"href": "/materialType_view",
"icon": "fa fa-th-list",
"target": "_self"
}
]
},
{
"title": "物料管理",
"icon": "fa fa-wrench",
"target": "_self",
"child": [
{
"title": "创建物料",
"href": "/material_add",
"icon": "layui-icon layui-icon-template-1",
"target": "_self"
},
{
"title": "物料查询",
"href": "/material_out",
"icon": "fa fa-th-list",
"target": "_self"
}
]
},
{
"title": "我的任务",
"icon": "fa fa-tasks",
"target": "_self",
"href": "/my_task"
},
{
"title": "我的申请",
"href": "/my_apply",
"icon": "fa fa-paper-plane",
"target": "_self"
}
]
},
{
"title": "辅助管理",
"icon": "fa fa-slideshare",
"href": "",
"target": "_self",
"child": [
{
"title": "人员管理",
"href": "/table_user",
"icon": "fa fa-group",
"target": ""
},
{
"title": "公告发布",
"href": "/notice_edit",
"icon": "fa fa-superpowers",
"target": "_self"
}
]
},
{
"title": "个人中心",
"href": "pages/error.html",
"icon": "fa fa-superpowers",
"target": "_self",
"child": [
{
"title": "个人信息",
"href": "/account_look",
"icon": "layui-icon layui-icon-friends",
"target": ""
}
]
}
]
}

220
target/classes/static/api/init_checker.json

@ -1,220 +0,0 @@
{
"homeInfo": {
"title": "首页",
"href": "/welcome"
},
"logoInfo": {
"title": "Repository",
"image": "static/images/logo.png",
"href": ""
},
"menuInfo": [
{
"title": "仓库信息概览",
"href": "/welcome",
"icon": "fa fa-tachometer",
"target": "_self",
"child": [
{
"title": "首页",
"href": "/welcome",
"icon": "fa fa-home",
"target": "_self"
}
]
},
{
"title": "仓库管理",
"icon": "fa fa-lemon-o",
"href": "",
"target": "_self",
"child": [
{
"title": "申请提交",
"icon": "fa fa-book",
"target": "_self",
"child": [
{
"title": "入库申请",
"href": "/application_in",
"icon": "layui-icon layui-icon-file-b",
"target": "_self"
},
{
"title": "出库申请",
"href": "/application_out",
"icon": "fa fa-file-text",
"target": "_self"
},
{
"title": "库存转移申请",
"href": "application_transfer",
"icon": "fa fa-exchange",
"target": "_self"
}
]
},
{
"title": "入库管理",
"icon": "fa fa-mail-forward",
"target": "_self",
"child": [
{
"title": "入库查询",
"href": "/table_in",
"icon": "fa fa-th-list",
"target": "_self"
},
{
"title": "入库可视化",
"href": "/chart_in",
"icon": "fa fa-bar-chart",
"target": "_self"
},
{
"title": "入库可视化(测试)",
"href": "/chart_in_back",
"icon": "fa fa-bar-chart",
"target": "_self"
}
]
},
{
"title": "出库管理",
"icon": "fa fa-mail-reply",
"target": "_self",
"child": [
{
"title": "出库查询",
"href": "/table_out",
"icon": "fa fa-th-list",
"target": "_self"
},
{
"title": "出库可视化",
"href": "/chart_out",
"icon": "fa fa-pie-chart",
"target": "_self"
}
]
},
{
"title": "库存管理",
"icon": "fa fa-server",
"target": "_self",
"child": [
{
"title": "库存查询",
"href": "/table_stock",
"icon": "fa fa-th-list",
"target": "_self"
},
{
"title": "库存可视化",
"href": "/chart_stock",
"icon": "fa fa-area-chart",
"target": "_self"
}
]
},
{
"title": "仓库管理",
"icon": "fa fa-wrench",
"target": "_self",
"child": [
{
"title": "创建仓库",
"href": "/depository_add",
"icon": "layui-icon layui-icon-template-1",
"target": "_self"
},
{
"title": "仓库查询",
"href": "/depository-out",
"icon": "fa fa-th-list",
"target": "_self"
}
]
},
{
"title": "物料种类管理",
"icon": "fa fa-wrench",
"target": "_self",
"child": [
{
"title": "物料种类添加",
"href": "/materialType_add",
"icon": "layui-icon layui-icon-list",
"target": "_self"
},
{
"title": "物料种类查询",
"href": "/materialType_view",
"icon": "fa fa-th-list",
"target": "_self"
}
]
},
{
"title": "物料管理",
"icon": "fa fa-wrench",
"target": "_self",
"child": [
{
"title": "创建物料",
"href": "/material_add",
"icon": "layui-icon layui-icon-template-1",
"target": "_self"
},
{
"title": "物料查询",
"href": "/material_out",
"icon": "fa fa-th-list",
"target": "_self"
}
]
},
{
"title": "我的任务",
"icon": "fa fa-tasks",
"target": "_self",
"href": "/my_task"
},
{
"title": "我的申请",
"href": "/my_apply",
"icon": "fa fa-paper-plane",
"target": "_self"
}
]
},
{
"title": "辅助管理",
"icon": "fa fa-slideshare",
"href": "",
"target": "_self",
"child": [
{
"title": "公告发布",
"href": "/notice_edit",
"icon": "fa fa-superpowers",
"target": "_self"
}
]
},
{
"title": "个人中心",
"href": "pages/error.html",
"icon": "fa fa-superpowers",
"target": "_self",
"child": [
{
"title": "个人信息",
"href": "/account_look",
"icon": "layui-icon layui-icon-friends",
"target": ""
}
]
}
]
}

226
target/classes/static/api/init_reviewer.json

@ -1,226 +0,0 @@
{
"homeInfo": {
"title": "首页",
"href": "/welcome"
},
"logoInfo": {
"title": "Repository",
"image": "static/images/logo.png",
"href": ""
},
"menuInfo": [
{
"title": "仓库信息概览",
"href": "/welcome",
"icon": "fa fa-tachometer",
"target": "_self",
"child": [
{
"title": "首页",
"href": "/welcome",
"icon": "fa fa-home",
"target": "_self"
}
]
},
{
"title": "仓库管理",
"icon": "fa fa-lemon-o",
"href": "",
"target": "_self",
"child": [
{
"title": "申请提交",
"icon": "fa fa-book",
"target": "_self",
"child": [
{
"title": "入库申请",
"href": "/application_in",
"icon": "layui-icon layui-icon-file-b",
"target": "_self"
},
{
"title": "出库申请",
"href": "/application_out",
"icon": "fa fa-file-text",
"target": "_self"
},
{
"title": "库存转移申请",
"href": "application_transfer",
"icon": "fa fa-exchange",
"target": "_self"
}
]
},
{
"title": "入库管理",
"icon": "fa fa-mail-forward",
"target": "_self",
"child": [
{
"title": "入库查询",
"href": "/table_in",
"icon": "fa fa-th-list",
"target": "_self"
},
{
"title": "入库可视化",
"href": "/chart_in",
"icon": "fa fa-bar-chart",
"target": "_self"
},
{
"title": "入库可视化(测试)",
"href": "/chart_in_back",
"icon": "fa fa-bar-chart",
"target": "_self"
}
]
},
{
"title": "出库管理",
"icon": "fa fa-mail-reply",
"target": "_self",
"child": [
{
"title": "出库查询",
"href": "/table_out",
"icon": "fa fa-th-list",
"target": "_self"
},
{
"title": "出库可视化",
"href": "/chart_out",
"icon": "fa fa-pie-chart",
"target": "_self"
}
]
},
{
"title": "库存管理",
"icon": "fa fa-server",
"target": "_self",
"child": [
{
"title": "库存查询",
"href": "/table_stock",
"icon": "fa fa-th-list",
"target": "_self"
},
{
"title": "库存可视化",
"href": "/chart_stock",
"icon": "fa fa-area-chart",
"target": "_self"
}
]
},
{
"title": "仓库管理",
"icon": "fa fa-wrench",
"target": "_self",
"child": [
{
"title": "创建仓库",
"href": "/depository_add",
"icon": "layui-icon layui-icon-template-1",
"target": "_self"
},
{
"title": "仓库查询",
"href": "/depository-out",
"icon": "fa fa-th-list",
"target": "_self"
}
]
},
{
"title": "物料种类管理",
"icon": "fa fa-wrench",
"target": "_self",
"child": [
{
"title": "物料种类添加",
"href": "/materialType_add",
"icon": "layui-icon layui-icon-list",
"target": "_self"
},
{
"title": "物料种类查询",
"href": "/materialType_view",
"icon": "fa fa-th-list",
"target": "_self"
}
]
},
{
"title": "物料管理",
"icon": "fa fa-wrench",
"target": "_self",
"child": [
{
"title": "创建物料",
"href": "/material_add",
"icon": "layui-icon layui-icon-template-1",
"target": "_self"
},
{
"title": "物料查询",
"href": "/material_out",
"icon": "fa fa-th-list",
"target": "_self"
}
]
},
{
"title": "我的任务",
"icon": "fa fa-tasks",
"target": "_self",
"href": "/my_task"
},
{
"title": "我的申请",
"href": "/my_apply",
"icon": "fa fa-paper-plane",
"target": "_self"
}
]
},
{
"title": "辅助管理",
"icon": "fa fa-slideshare",
"href": "",
"target": "_self",
"child": [
{
"title": "人员管理",
"href": "/table_user",
"icon": "fa fa-group",
"target": ""
},
{
"title": "公告发布",
"href": "/notice_edit",
"icon": "fa fa-superpowers",
"target": "_self"
}
]
},
{
"title": "个人中心",
"href": "pages/error.html",
"icon": "fa fa-superpowers",
"target": "_self",
"child": [
{
"title": "个人信息",
"href": "/account_look",
"icon": "layui-icon layui-icon-friends",
"target": ""
}
]
}
]
}

100
target/classes/static/api/init_user.json

@ -1,100 +0,0 @@
{
"homeInfo": {
"title": "首页",
"href": "/welcome"
},
"logoInfo": {
"title": "Repository",
"image": "static/images/logo.png",
"href": ""
},
"menuInfo": [
{
"title": "仓库信息概览",
"href": "/welcome",
"icon": "fa fa-tachometer",
"target": "_self",
"child": [
{
"title": "首页",
"href": "/welcome",
"icon": "fa fa-home",
"target": "_self"
}
]
},
{
"title": "仓库管理",
"icon": "fa fa-lemon-o",
"href": "",
"target": "_self",
"child": [
{
"title": "申请提交",
"icon": "fa fa-book",
"target": "_self",
"child": [
{
"title": "入库申请",
"href": "/application_in",
"icon": "layui-icon layui-icon-file-b",
"target": "_self"
},
{
"title": "出库申请",
"href": "/application_out",
"icon": "fa fa-file-text",
"target": "_self"
},
{
"title": "库存转移申请",
"href": "application_transfer",
"icon": "fa fa-exchange",
"target": "_self"
}
]
},
{
"title": "我的任务",
"icon": "fa fa-tasks",
"target": "_self",
"href": "/my_task"
},
{
"title": "我的申请",
"href": "/my_apply",
"icon": "fa fa-paper-plane",
"target": "_self"
}
]
},
{
"title": "辅助管理",
"icon": "fa fa-slideshare",
"href": "",
"target": "_self",
"child": [
{
"title": "公告发布",
"href": "/notice_edit",
"icon": "fa fa-superpowers",
"target": "_self"
}
]
},
{
"title": "个人中心",
"href": "pages/error.html",
"icon": "fa fa-superpowers",
"target": "_self",
"child": [
{
"title": "个人信息",
"href": "/account_look",
"icon": "layui-icon layui-icon-friends",
"target": ""
}
]
}
]
}

254
target/classes/static/api/menus.json

@ -1,254 +0,0 @@
{
"code": 0,
"msg": "",
"count": 19,
"data": [
{
"authorityId": 1,
"authorityName": "系统管理",
"orderNumber": 1,
"menuUrl": null,
"menuIcon": "layui-icon-set",
"createTime": "2018/06/29 11:05:41",
"authority": null,
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 0,
"parentId": -1
},
{
"authorityId": 2,
"authorityName": "用户管理",
"orderNumber": 2,
"menuUrl": "system/user",
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": null,
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 0,
"parentId": 1
},
{
"authorityId": 3,
"authorityName": "查询用户",
"orderNumber": 3,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/07/21 13:54:16",
"authority": "user:view",
"checked": 0,
"updateTime": "2018/07/21 13:54:16",
"isMenu": 1,
"parentId": 2
},
{
"authorityId": 4,
"authorityName": "添加用户",
"orderNumber": 4,
"menuUrl": null,
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": "user:add",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 2
},
{
"authorityId": 5,
"authorityName": "修改用户",
"orderNumber": 5,
"menuUrl": null,
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": "user:edit",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 2
},
{
"authorityId": 6,
"authorityName": "删除用户",
"orderNumber": 6,
"menuUrl": null,
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": "user:delete",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 2
},
{
"authorityId": 7,
"authorityName": "角色管理",
"orderNumber": 7,
"menuUrl": "system/role",
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": null,
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 0,
"parentId": 1
},
{
"authorityId": 8,
"authorityName": "查询角色",
"orderNumber": 8,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/07/21 13:54:59",
"authority": "role:view",
"checked": 0,
"updateTime": "2018/07/21 13:54:58",
"isMenu": 1,
"parentId": 7
},
{
"authorityId": 9,
"authorityName": "添加角色",
"orderNumber": 9,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "role:add",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 7
},
{
"authorityId": 10,
"authorityName": "修改角色",
"orderNumber": 10,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "role:edit",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 7
},
{
"authorityId": 11,
"authorityName": "删除角色",
"orderNumber": 11,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "role:delete",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 7
},
{
"authorityId": 12,
"authorityName": "角色权限管理",
"orderNumber": 12,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "role:auth",
"checked": 0,
"updateTime": "2018/07/13 15:27:18",
"isMenu": 1,
"parentId": 7
},
{
"authorityId": 13,
"authorityName": "权限管理",
"orderNumber": 13,
"menuUrl": "system/authorities",
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": null,
"checked": 0,
"updateTime": "2018/07/13 15:45:13",
"isMenu": 0,
"parentId": 1
},
{
"authorityId": 14,
"authorityName": "查询权限",
"orderNumber": 14,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/07/21 13:55:57",
"authority": "authorities:view",
"checked": 0,
"updateTime": "2018/07/21 13:55:56",
"isMenu": 1,
"parentId": 13
},
{
"authorityId": 15,
"authorityName": "添加权限",
"orderNumber": 15,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "authorities:add",
"checked": 0,
"updateTime": "2018/06/29 11:05:41",
"isMenu": 1,
"parentId": 13
},
{
"authorityId": 16,
"authorityName": "修改权限",
"orderNumber": 16,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/07/13 09:13:42",
"authority": "authorities:edit",
"checked": 0,
"updateTime": "2018/07/13 09:13:42",
"isMenu": 1,
"parentId": 13
},
{
"authorityId": 17,
"authorityName": "删除权限",
"orderNumber": 17,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/06/29 11:05:41",
"authority": "authorities:delete",
"checked": 0,
"updateTime": "2018/06/29 11:05:41",
"isMenu": 1,
"parentId": 13
},
{
"authorityId": 18,
"authorityName": "登录日志",
"orderNumber": 18,
"menuUrl": "system/loginRecord",
"menuIcon": null,
"createTime": "2018/06/29 11:05:41",
"authority": null,
"checked": 0,
"updateTime": "2018/06/29 11:05:41",
"isMenu": 0,
"parentId": 1
},
{
"authorityId": 19,
"authorityName": "查询登录日志",
"orderNumber": 19,
"menuUrl": "",
"menuIcon": "",
"createTime": "2018/07/21 13:56:43",
"authority": "loginRecord:view",
"checked": 0,
"updateTime": "2018/07/21 13:56:43",
"isMenu": 1,
"parentId": 18
}
]
}

139
target/classes/static/api/table-in.json

@ -1,139 +0,0 @@
{
"code": 0,
"msg": "",
"count": 1000,
"data": [
{
"id": 10000,
"applicationId": 2001,
"materialName": "骁龙888芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "购入",
"state": "待审核",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2020-10-06 10:05",
"reviewTime": "无",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准"
},
{
"id": 10001,
"applicationId": 3301,
"materialName": "麒麟980芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "购入",
"state": "已入库",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2021-10-06 10:05",
"reviewRemarks": "审核批准!",
"reviewTime": "2021-10-07 11:12",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准",
"checkerName": "李四",
"checkRemarks": "验收无误,入库!",
"checkTime": "2021-10-8 15:23"
},
{
"id": 10002,
"applicationId": 409,
"materialName": "骁龙888芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "购入",
"state": "待审核",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2020-10-06 10:05",
"reviewTime": "2020-10-07 11:12",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准"
},
{
"id": 10000,
"applicationId": 123,
"materialName": "骁龙888芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "转入",
"state": "待审核",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2020-10-06 10:05",
"reviewTime": "2020-10-07 11:12",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准"
},
{
"id": 10000,
"applicationId": 321,
"materialName": "骁龙888芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "转入",
"state": "待审核",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2020-10-06 10:05",
"reviewTime": "2020-10-07 11:12",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准"
},
{
"id": 10000,
"applicationId": 456,
"materialName": "骁龙888芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "转入",
"state": "待审核",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2020-10-06 10:05",
"reviewTime": "2020-10-07 11:12",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准"
},
{
"id": 10000,
"applicationId": 456,
"materialName": "骁龙888芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "购入",
"state": "待审核",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2020-10-06 10:05",
"reviewTime": "2020-10-07 11:12",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准"
},
{
"id": 10000,
"applicationId": 123,
"materialName": "骁龙888芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "转入",
"state": "待审核",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2020-10-06 10:05",
"reviewTime": "2020-10-07 11:12",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准"
}
]
}

136
target/classes/static/api/table-out.json

@ -1,136 +0,0 @@
{
"code": 0,
"msg": "",
"count": 1000,
"data": [
{
"id": 10000,
"applicationId": 2001,
"materialName": "骁龙888芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "购入",
"state": "待审核",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2020-10-06 10:05",
"reviewTime": "无",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准"
},
{
"id": 10001,
"applicationId": 3301,
"materialName": "麒麟980芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "购入",
"state": "已入库",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2021-10-06 10:05",
"reviewRemarks": "审核批准!",
"reviewTime": "2021-10-07 11:12",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准"
},
{
"id": 10002,
"applicationId": 409,
"materialName": "骁龙888芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "购入",
"state": "待审核",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2020-10-06 10:05",
"reviewTime": "2020-10-07 11:12",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准"
},
{
"id": 10000,
"applicationId": 123,
"materialName": "骁龙888芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "转入",
"state": "待审核",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2020-10-06 10:05",
"reviewTime": "2020-10-07 11:12",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准"
},
{
"id": 10000,
"applicationId": 321,
"materialName": "骁龙888芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "转入",
"state": "待审核",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2020-10-06 10:05",
"reviewTime": "2020-10-07 11:12",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准"
},
{
"id": 10000,
"applicationId": 456,
"materialName": "骁龙888芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "转入",
"state": "待审核",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2020-10-06 10:05",
"reviewTime": "2020-10-07 11:12",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准"
},
{
"id": 10000,
"applicationId": 456,
"materialName": "骁龙888芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "购入",
"state": "待审核",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2020-10-06 10:05",
"reviewTime": "2020-10-07 11:12",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准"
},
{
"id": 10000,
"applicationId": 123,
"materialName": "骁龙888芯片",
"depositoryName": "外芯仓库",
"quantity": "409",
"price": "205004109",
"type": "转入",
"state": "待审核",
"applicantName": "张三",
"reviewerName": "King",
"applyTime": "2020-10-06 10:05",
"reviewTime": "2020-10-07 11:12",
"depositoryId": 57,
"applyRemarks": "老板要求今天这批货得进库,请尽快批准"
}
]
}

95
target/classes/static/api/table-user.json

@ -1,95 +0,0 @@
{
"code": 0,
"msg": "",
"count": 1000,
"data": [
{
"id": 10000,
"uname": "张三",
"sex": "男",
"authority": "仓管员",
"phone": "4561348",
"email": "12345689@qq.com",
"depositoryName": "外芯仓库",
"entryDate": "2012-10-06",
"depositoryId": 1
},
{
"id": 10000,
"uname": "李四",
"sex": "男",
"authority": "仓管员",
"phone": "4561348",
"email": "12345689@qq.com",
"depositoryName": "义乌仓库a",
"entryDate": "2012-10-06",
"depositoryId": 1
},
{
"id": 10000,
"uname": "King",
"sex": "男",
"authority": "仓管员",
"phone": "4561348",
"email": "12345689@qq.com",
"depositoryName": "义乌仓库b",
"entryDate": "2012-10-06",
"depositoryId": 1
},
{
"id": 10000,
"uname": "张三",
"sex": "男",
"authority": "仓管员",
"phone": "4561348",
"email": "12345689@qq.com",
"depositoryName": "宁波仓库",
"entryDate": "2012-10-06",
"depositoryId": 1
},
{
"id": 10000,
"uname": "张三",
"sex": "男",
"authority": "仓管员",
"phone": "4561348",
"email": "12345689@qq.com",
"depositoryName": "宁波仓库",
"entryDate": "2012-10-06",
"depositoryId": 1
},
{
"id": 10000,
"uname": "boss",
"sex": "男",
"authority": "系统管理员",
"phone": "4561348",
"email": "12345689@qq.com",
"depositoryName": "all",
"entryDate": "2012-10-06",
"depositoryId": 1
},
{
"id": 10000,
"uname": "张三",
"sex": "男",
"authority": "仓管员",
"phone": "4561348",
"email": "12345689@qq.com",
"depositoryName": "外芯仓库",
"entryDate": "2012-10-06",
"depositoryId": 1
},
{
"id": 10000,
"uname": "张三",
"sex": "男",
"authority": "仓管员",
"phone": "4561348",
"email": "12345689@qq.com",
"depositoryName": "外芯仓库",
"entryDate": "2012-10-06",
"depositoryId": 1
}
]
}

87
target/classes/static/api/tableSelect.json

@ -1,87 +0,0 @@
{
"code": 0,
"msg": "",
"count": 16,
"data": [
{
"id": "001",
"username": "张玉林",
"sex": "女"
},
{
"id": "002",
"username": "刘晓军",
"sex": "男"
},
{
"id": "003",
"username": "张恒",
"sex": "男"
},
{
"id": "004",
"username": "朱一",
"sex": "男"
},
{
"id": "005",
"username": "刘佳能",
"sex": "女"
},
{
"id": "006",
"username": "晓梅",
"sex": "女"
},
{
"id": "007",
"username": "马冬梅",
"sex": "女"
},
{
"id": "008",
"username": "刘晓庆",
"sex": "女"
},
{
"id": "009",
"username": "刘晓庆",
"sex": "女"
},
{
"id": "010",
"username": "刘晓庆",
"sex": "女"
},
{
"id": "011",
"username": "刘晓庆",
"sex": "女"
},
{
"id": "012",
"username": "刘晓庆",
"sex": "女"
},
{
"id": "013",
"username": "刘晓庆",
"sex": "女"
},
{
"id": "014",
"username": "刘晓庆",
"sex": "女"
},
{
"id": "015",
"username": "刘晓庆",
"sex": "女"
},
{
"id": "016",
"username": "刘晓庆",
"sex": "女"
}
]
}

225
target/classes/static/api/test.json

@ -1,225 +0,0 @@
{
"homeInfo": {
"title": "首页",
"href": "/welcome"
},
"logoInfo": {
"title": "Repository",
"image": "static/images/logo.png",
"href": ""
},
"menuInfo": [
{
"icon": "fa fa-home",
"href": "/welcome",
"title": "仓库信息概览",
"target": "_self",
"child": [
{
"icon": "fa fa-home",
"href": "/welcome",
"title": "首页",
"target": "_self",
"child": []
}
]
},
{
"icon": "layui-icon layui-icon-template-1",
"href": "/account_look",
"title": "个人中心",
"target": "_self",
"child": []
},
{
"icon": "fa fa-lemon-o",
"href": "",
"title": "仓库管理",
"target": "_self",
"child": [
{
"icon": "layui-icon layui-icon-template-1",
"href": "/my_task",
"title": "我的任务",
"target": "_self",
"child": []
},
{
"icon": "layui-icon layui-icon-template-1",
"href": "/my_apply",
"title": "我的申请",
"target": "_self",
"child": []
},
{
"icon": "fa fa-mail-forward",
"href": "",
"title": "申请提交",
"target": "_self",
"child": [
{
"icon": "layui-icon layui-icon-file-b",
"href": "/application_in",
"title": "入库申请",
"target": "_self"
},
{
"icon": "fa fa-file-text",
"href": "/application_out",
"title": "出库申请",
"target": "_self"
},
{
"icon": "fa fa-exchange",
"href": "/application_transfer",
"title": "库存转移申请",
"target": "_self"
}
]
},
{
"icon": "fa fa-mail-forward",
"href": "",
"title": "入库管理",
"target": "_self",
"child": [
{
"icon": "fa fa-th-list",
"href": "/table_in",
"title": "入库查询",
"target": "_self"
},
{
"icon": "fa fa-bar-chart",
"href": "/chart_in",
"title": "入库可视化",
"target": "_self"
}
]
},
{
"icon": "fa fa-mail-forward",
"href": "",
"title": "出库管理",
"target": "_self",
"child": [
{
"icon": "fa fa-th-list",
"href": "/table_out",
"title": "出库查询",
"target": "_self"
},
{
"icon": "fa fa-pie-chart",
"href": "/chart_out",
"title": "出库可视化",
"target": "_self"
}
]
},
{
"icon": "fa fa-mail-forward",
"href": "",
"title": "库存管理",
"target": "_self",
"child": [
{
"icon": "fa fa-th-list",
"href": "/table_stock",
"title": "库存查询",
"target": "_self"
},
{
"icon": "fa fa-area-chart",
"href": "/chart_stock",
"title": "库存可视化",
"target": "_self"
}
]
},
{
"icon": "fa fa-mail-forward",
"href": "",
"title": "仓库管理",
"target": "_self",
"child": [
{
"icon": "layui-icon layui-icon-template-1",
"href": "/depository_add",
"title": "创建仓库",
"target": "_self"
},
{
"icon": "fa fa-th-list",
"href": "/depository-out",
"title": "仓库查询",
"target": "_self"
}
]
},
{
"icon": "fa fa-mail-forward",
"href": "",
"title": "物料种类管理",
"target": "_self",
"child": [
{
"icon": "fa fa-th-list",
"href": "/materialType_add",
"title": "物料种类添加",
"target": "_self"
},
{
"icon": "layui-icon layui-icon-template-1",
"href": "/materialType_view",
"title": "物料种类查询",
"target": "_self"
}
]
},
{
"icon": "fa fa-mail-forward",
"href": "",
"title": "物料管理",
"target": "_self",
"child": [
{
"icon": "layui-icon layui-icon-template-1",
"href": "/material_add",
"title": "创建物料",
"target": "_self"
},
{
"icon": "layui-icon layui-icon-template-1",
"href": "/material_out",
"title": "物料查询",
"target": "_self"
}
]
}
]
},
{
"icon": "fa fa-slideshare",
"href": "",
"title": "辅助管理",
"target": "_self",
"child": [
{
"icon": "layui-icon layui-icon-template-1",
"href": "/table_user",
"title": "人员管理",
"target": "_self",
"child": []
},
{
"icon": "layui-icon layui-icon-template-1",
"href": "/notice_edit",
"title": "公告发布",
"target": "_self",
"child": []
}
]
}
]
}

10
target/classes/static/api/upload.json

@ -1,10 +0,0 @@
{
"code": 1,
"msg": "上传成功",
"data": {
"url": [
"../images/logo.png",
"../images/captcha.jpg"
]
}
}

934
target/classes/static/css/layuimini.css

@ -1,934 +0,0 @@
/**
配色方案如有需要请自行配置
*/
/**头部-配色*/
.layui-layout-admin .layui-header {
background-color: #1aa094 !important;
}
.layui-header > ul > .layui-nav-item.layui-this, .layuimini-tool i:hover {
background-color: #197971 !important;
}
.layui-header .layuimini-header-content > ul > .layui-nav-item.layui-this, .layuimini-tool i:hover {
background-color: #197971 !important;
}
/**logo-配色*/
.layui-layout-admin .layuimini-logo {
background-color: #243346 !important;
}
/**左侧-配色*/
.layui-side.layui-bg-black, .layui-side.layui-bg-black > .layuimini-menu-left > ul {
background-color: #2f4056 !important;
}
.layuimini-menu-left .layui-nav .layui-nav-child a:hover:not(.layui-this) {
background-color: #3b3f4b;
}
/**左侧菜单选中-配色*/
.layui-layout-admin .layui-nav-tree .layui-this, .layui-layout-admin .layui-nav-tree .layui-this > a, .layui-layout-admin .layui-nav-tree .layui-nav-child dd.layui-this, .layui-layout-admin .layui-nav-tree .layui-nav-child dd.layui-this a {
background-color: #1aa094 !important;
}
/**头部样式 */
.layui-layout-admin .header {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.layuimini-header-menu, .layui-header {
height: 60px !important;
}
.layuimini-header-menu > .layui-nav-item {
color: #1b1d21;
height: 60px !important;
line-height: 60px !important;
}
.layui-header > .layui-layout-right > .layui-nav-item {
height: 60px !important;
line-height: 60px !important;
}
.layui-layout-left {
left: 295px !important;
}
.layui-nav.layui-layout-left.layuimini-header-menu.layuimini-pc-show {
font-weight: bold;
transition: all .2s;
}
/**logo演示(通用) */
.layui-layout-admin .layuimini-logo {
font-weight: bold;
color: #ffffff !important;
height: 60px !important;
line-height: 60px !important;
overflow: hidden;
line-height: 64px;
transition: all .2s !important;
}
.layui-layout-admin .layuimini-logo img {
display: inline-block;
height: 40px;
vertical-align: middle;
}
.layui-layout-admin .layuimini-logo h1 {
display: inline-block;
margin: 0 0 0 12px;
color: #ffffff;
font-weight: 600;
font-size: 20px;
font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
vertical-align: middle;
}
/**缩放工具(通用) */
.layuimini-tool {
position: absolute !important;
top: 0;
left: 235px;
width: 60px;
height: 100%;
line-height: 60px;
text-align: center;
color: #ffffff !important;
transition: all .2s;
}
/**缩放工具(缩放) */
.layuimini-tool i {
display: block;
color: #bbe3df;
width: 32px;
height: 32px;
line-height: 32px;
border-radius: 3px;
text-align: center;
margin-top: 15px;
cursor: pointer;
}
/**tab选项卡 */
.layuimini-tab {
margin: 0px;
overflow: hidden;
height: 100% !important;
}
.layuimini-tab .layui-tab-content {
height: calc(100% - 37px) !important;
}
.layuimini-tab .layui-tab-content .layui-tab-item {
height: 100%;
}
.layuimini-tab .layui-tab-content {
padding: 0px;
}
.layuimini-tab .layui-tab-title {
border: none;
border: 1px solid whitesmoke;
background-color: white;
}
.layuimini-tab .layui-tab-title li {
border-right: 1px solid whitesmoke;
color: dimgray;
}
.layuimini-tab .layui-tab-title .layui-tab-bar {
display: none;
}
.layuimini-tab .layui-tab-title .layui-this:after {
display: none;
}
.layuimini-tab .layui-tab-title .layuimini-tab-active {
display: inline-block;
background-color: lightgray;
width: 9px;
height: 9px;
border-radius: 30px;
margin-right: 5px;
}
.layuimini-tab .layui-tab-title .layui-this .layuimini-tab-active {
background-color: #1aa094;
}
.layuimini-tab > .layui-tab-title, .layuimini-tab > .close-box {
height: 35px !important;
}
.layuimini-tab > .layui-tab-title li, .layuimini-tab > .close-box li {
line-height: 35px !important;
}
.layuimini-tab .layui-tab-title span {
color: #acafb1;
}
.layuimini-tab .layui-tab-title .layui-this span {
color: dimgray;
}
.layuimini-tab .layui-tab-title .layui-tab-close {
font-size: 12px !important;
width: 14px !important;
height: 14px !important;
line-height: 16px !important;
}
.layuimini-tab .layui-tab-title .layui-tab-close:hover {
border-radius: 4em;
background: #ff5722;
}
.layuimini-tab .layui-tab-title .disable-close + .layui-tab-close {
display: none;
}
.layuimini-tab .layui-tab-title .able-close + .layui-tab-close {
display: inline-block;
}
.layuimini-tab .layui-tab-control > li {
position: absolute;
top: 0px;
height: 35px;
line-height: 35px;
width: 35px;
text-align: center;
background-color: white;
border-top: whitesmoke 1px solid;
border-bottom: whitesmoke 1px solid;
}
.layuimini-tab .layuimini-tab-roll-left {
left: 0px;
border-right: whitesmoke 1px solid;
border-left: whitesmoke 1px solid;
}
.layuimini-tab .layuimini-tab-roll-right {
right: 35px;
border-left: 1px solid whitesmoke;
}
.layuimini-tab .layui-tab-tool {
right: 0px;
border-left: 1px solid whitesmoke;
}
.layuimini-tab .layui-tab-control .layui-tab-tool,
.layuimini-tab .layui-tab-control .layuimini-tab-roll-left,
.layuimini-tab .layui-tab-control .layuimini-tab-roll-right {
display: none;
}
.layuimini-tab.layui-tab-roll .layui-tab-control .layuimini-tab-roll-left,
.layuimini-tab.layui-tab-roll .layui-tab-control .layuimini-tab-roll-right {
display: block;
}
.layuimini-tab.layui-tab-roll .layui-tab-control .layuimini-tab-roll-right {
right: 0px;
border-right: 1px solid whitesmoke;
}
.layuimini-tab.layui-tab-roll .layui-tab-title {
padding-left: 35px;
padding-right: 35px;
}
.layuimini-tab.layui-tab-tool .layui-tab-control .layui-tab-tool {
display: block;
}
.layuimini-tab.layui-tab-tool .layui-tab-title {
padding-left: 0px;
padding-right: 35px;
}
.layuimini-tab.layui-tab-rollTool .layui-tab-title {
padding-left: 35px;
padding-right: 80px;
}
.layuimini-tab.layui-tab-rollTool .layui-tab-control .layuimini-tab-roll-left,
.layuimini-tab.layui-tab-rollTool .layui-tab-control .layuimini-tab-roll-right,
.layuimini-tab.layui-tab-rollTool .layui-tab-control .layui-tab-tool {
display: block;
}
.layuimini-tab .layui-tab-tool .layui-nav {
position: absolute;
height: 43px !important;
top: 0;
width: 100%;
height: 100%;
padding: 0;
background: 0 0;
}
.layuimini-tab .layui-tab-tool .layui-nav-item {
height: 35px;
}
.layuimini-tab .layui-tab-tool .layui-nav-bar {
display: none;
}
.layuimini-tab .layui-tab-tool .layui-nav-child {
left: auto;
top: 45px;
right: 3px;
width: 120px;
border: 1px solid whitesmoke;
}
.layuimini-tab .layui-tab-tool .layui-this a {
background-color: #009688;
}
.layuimini-tab-loading {
position: absolute;
display: none;
width: 100%;
height: calc(100% - 37px);
top: 37px;
z-index: 19;
background-color: #fff
}
.layuimini-tab-loading.close {
animation: close 1s;
-webkit-animation: close 1s;
animation-fill-mode: forwards;
}
/**左侧菜单栏 (通用) */
.layui-side.layui-bg-black {
transition: all .2s;
}
.layui-side.layui-bg-black > .layuimini-menu-left > ul {
transition: all .2s;
}
.layui-side.layui-bg-black > .layuimini-menu-left > ul > .layui-nav-item:first-child {
border-top: 1px solid #4b5461;
}
.layuimini-menu-left .layui-nav .layui-nav-item a {
height: 40px;
line-height: 40px;
padding-right: 30px;
}
.layuimini-menu-left .layui-nav .layui-nav-item > a {
padding-top: 5px;
padding-bottom: 5px;
}
.layuimini-menu-left .layui-nav .layui-nav-child .layui-nav-child {
background: 0 0 !important
}
.layuimini-menu-left .layui-nav .layui-nav-more {
right: 15px;
}
.layuimini-menu-left .layui-nav .layui-nav-item a:hover {
background-color: transparent !important;
}
.layuimini-menu-left .layui-nav {
background-color: transparent !important;
}
/**左侧菜单栏 (正常) */
.layui-layout-body .layui-nav-itemed .layui-nav-child a, .layui-layout-body .layuimini-menu-left .layui-nav .layui-nav-child a {
padding-left: 35px;
}
.layui-layout-body .layuimini-menu-left .layui-nav .layui-nav-child .layui-nav-child a {
padding-left: 45px;
}
.layui-layout-body .layuimini-menu-left .layui-nav .layui-nav-child .layui-nav-child .layui-nav-child a {
padding-left: 55px;
}
.layui-layout-body .layuimini-menu-left .layui-nav .layui-nav-child .layui-nav-child .layui-nav-child .layui-nav-child a {
padding-left: 65px;
}
.layui-layout-body .layuimini-menu-left .layui-nav .layui-nav-itemed > .layui-nav-child {
padding: 5px 0;
}
/**内容主体(通用) */
.layui-layout-admin .layui-body {
overflow: hidden;
bottom: 0px !important;
top: 60px !important;
transition: all .2s;
}
/**选择配色方案 */
.layuimini-color .color-title {
padding: 10px 0 10px 20px;
border-bottom: 1px solid #d9dada;
margin-bottom: 8px;
}
.layuimini-color .color-content {
padding: 10px 5px 0 5px;
}
.layuimini-color .color-content ul {
list-style: none;
text-align: center;
}
.layuimini-color .color-content ul li {
position: relative;
display: inline-block;
vertical-align: top;
width: 80px;
height: 50px;
margin: 0 15px 15px 0;
padding: 2px 2px 4px 2px;
background-color: #f2f2f2;
cursor: pointer;
font-size: 12px;
color: #666;
}
.layuimini-color .color-content li.layui-this:after, .layuimini-color .color-content li:hover:after {
width: 100%;
height: 100%;
padding: 4px;
top: -5px;
left: -5px;
border-color: #d8d8d8;
opacity: 1;
}
.layuimini-color .color-content li:after {
content: '';
position: absolute;
z-index: 20;
top: 50%;
left: 50%;
width: 1px;
height: 0;
border: 1px solid #f2f2f2;
transition: all .3s;
-webkit-transition: all .3s;
opacity: 0;
}
/**其它 */
.layui-tab-item {
width: 100% !important;
height: 100% !important;
}
.layui-nav-item.layui-this {
background-color: #1b1d21;
}
.layui-width-height {
width: 100%;
height: 95%;
}
.layui-tab {
margin: 0 0 0 0;
z-index: 99999;
}
.text-center {
height: 30px !important;
line-height: 30px !important;
text-align: center !important;
}
.layui-nav {
padding: 0 !important;
}
.layui-nav .layui-this:after, .layui-nav-bar, .layui-nav-tree .layui-nav-itemed:after {
width: 0 !important;
height: 0 !important;
}
.layui-layout-admin .layui-side {
top: 60px !important;
}
.layui-tab-card {
box-shadow: 0px 0px 0px #888888;
border-bottom: 0;
}
/**自定义滚动条样式 */
::-webkit-scrollbar {
display: none
}
/*移动端遮罩层*/
.layuimini-make {
position: fixed;
left: 0;
right: 0;
bottom: 0;
top: 0;
z-index: 1000;
background: rgba(0, 0, 0, .5);
display: none;
}
.layuimini-mini .layui-header {
z-index: 1001;
}
/**初始化加载层*/
.layuimini-loader {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #ffffff;
z-index: 999999;
}
.layuimini-loader .layuimini-loader-inner {
display: block;
position: relative;
left: 50%;
top: 50%;
width: 150px;
height: 150px;
margin: -75px 0 0 -75px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #1E9FFF;
animation: spin 2s linear infinite;
}
.layuimini-loader .layuimini-loader-inner:before {
content: "";
position: absolute;
top: 5px;
left: 5px;
right: 5px;
bottom: 5px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #1E9FFF;
animation: spin 3s linear infinite;
}
.layuimini-loader .layuimini-loader-inner:after {
content: "";
position: absolute;
top: 15px;
left: 15px;
right: 15px;
bottom: 15px;
border-radius: 50%;
border: 3px solid transparent;
border-top-color: #1E9FFF;
animation: spin 1.5s linear infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
to {
transform: rotate(1turn);
}
}
/*系统设置*/
.layuimini-color .layui-word-aux {
position: absolute;
left: 60px;
top: 12px;
font-size: 12px;
}
.layuimini-color .layui-input-block {
margin-left: 15px;
min-height: 36px;
}
.layuimini-color .more-menu-list {
width: 100%;
margin-top: 30px;
}
.layuimini-color .more-menu-item:first-child {
border-top: 1px solid #e8e8e8;
}
.layuimini-color .more-menu-item .layui-icon {
font-size: 18px;
padding-right: 10px;
}
.layuimini-color .more-menu-item {
color: #595959;
height: 50px;
line-height: 50px;
font-size: 16px;
padding: 0 25px;
border-bottom: 1px solid #e8e8e8;
font-style: normal;
display: block;
}
.layuimini-color .more-menu-item:hover {
background-color: whitesmoke;
}
.layuimini-color .more-menu-item:after {
color: #8c8c8c;
right: 16px;
content: "\e602";
position: absolute;
font-family: layui-icon !important;
}
/**
鼠标右键
*/
.layuimini-tab-mousedown {
display: none;
width: 80px;
position: absolute;
top: 0px !important;
left: 0px !important;
}
.layuimini-tab-mousedown dd a {
padding: 0 15px;
color: #484545;
}
.layuimini-tab-make {
position: absolute;
top: 36px;
bottom: 0px;
width: 100%;
background: rgb(255, 255, 255, 0);
padding: 0px;
overflow: hidden;
}
/**
菜单缩放
*/
.popup-tips .layui-layer-TipsG {
display: none;
}
.popup-tips.layui-layer-tips .layui-layer-content {
padding: 0;
}
.popup-tips .layui-nav-tree {
width: 150px;
border-radius: 10px;
}
/**左侧菜单字体间距*/
.layuimini-menu-left .layui-nav-item a span {
letter-spacing: 1px;
}
/**头部菜单字体间距*/
.layui-layout-admin .layui-header .layuimini-header-menu.layuimini-pc-show, .layui-layout-admin .layui-header .layuimini-header-menu.layuimini-mobile-show {
letter-spacing: 1px;
}
/**左侧菜单更多下拉样式*/
.layuimini-menu-left .layui-nav-more, .layuimini-menu-left-zoom .layui-nav-more {
font-family: layui-icon !important;
font-size: 12px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
overflow: hidden;
width: auto;
height: auto;
line-height: normal;
border: none;
display: inline-block;
margin-top: -6px !important;
}
.layuimini-menu-left .layui-nav-child .layui-nav-more {
margin-top: -6px !important;
}
.layuimini-menu-left .layui-nav .layui-nav-mored, .layuimini-menu-left .layui-nav-itemed > a .layui-nav-more {
margin-top: -9px !important;
}
.layuimini-menu-left-zoom.layui-nav .layui-nav-mored, .layuimini-menu-left-zoom.layui-nav-itemed > a .layui-nav-more {
margin-top: -9px !important;
}
.layuimini-menu-left .layui-nav-more:before, .layuimini-menu-left-zoom .layui-nav-more:before {
content: "\e61a";
}
.layuimini-menu-left .layui-nav-itemed > a > .layui-nav-more, .layuimini-menu-left-zoom .layui-nav-itemed > a > .layui-nav-more {
transform: rotate(180deg);
-ms-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-webkit-transform: rotate(180deg);
-o-transform: rotate(180deg);
width: 12px;
text-align: center;
border-style: none;
}
.layuimini-menu-left .layui-nav-itemed > a > .layui-nav-more:before, .layuimini-menu-left-zoom .layui-nav-itemed > a > .layui-nav-more:before {
content: '\e61a';
background-color: transparent;
display: inline-block;
vertical-align: middle;
}
/**修复左侧菜单字体不对齐的问题*/
.layuimini-menu-left .layui-nav-item a .fa, .layuimini-menu-left .layui-nav-item a .layui-icon {
width: 20px;
}
/**
PC版样式
*/
@media screen and (min-width: 1025px) {
/**头部样式(缩放) */
.layuimini-mini .layui-layout-left.layuimini-header-menu.layuimini-pc-show {
left: 155px !important;
}
/**logo演示(缩放) */
.layuimini-mini .layui-layout-admin .layuimini-logo {
width: 60px !important;
}
.layuimini-mini .layui-layout-admin .layuimini-logo h1 {
display: none;
}
/**左侧菜单栏(缩放) */
.layuimini-mini .layuimini-menu-left {
width: 80px !important;
}
.layuimini-mini .layui-side.layui-bg-black, .layuimini-mini .layuimini-menu-left > ul, .layuimini-mini .layuimini-menu-left > ul li i {
width: 60px !important;
}
.layuimini-mini .layuimini-menu-left > ul li span:first-child {
display: none;
}
.layuimini-mini .layuimini-menu-left > ul li span:last-child {
float: right;
right: 7px;
}
.layuimini-mini .layuimini-menu-left .layui-nav .layui-nav-item a {
height: 40px;
line-height: 40px;
padding-right: 0px !important;
}
/**内容主体(缩放) */
.layuimini-mini .layui-layout-admin .layui-body {
left: 60px !important;
}
.layuimini-mini .layuimini-tool {
left: 95px !important;
}
.layuimini-pc-show {
display: block;
}
.layuimini-mobile-show {
display: none;
}
/**菜单缩放*/
.layuimini-mini .layuimini-menu-left .layui-nav-more, .layuimini-mini .layuimini-menu-left .layui-nav-child {
display: none;
!important;
}
}
/**
手机自适应样式
*/
@media screen and (max-width: 1024px) {
/**
todo 修复低版本IOS不能滑动问题, 但还是有问题, 低版本IOS部分情况下子页面无法自适应
*/
.layuimini-tab .layui-tab-content .layui-tab-item {
-webkit-overflow-scrolling: touch;
overflow: scroll;
width: 100%;
height: 100%;
}
.layuimini-tab .layui-tab-content .layui-tab-item iframe {
height: 100%;
width: 100%;
}
.layuimini-pc-show {
display: none;
}
.layuimini-mobile-show {
display: block;
}
.layuimini-header-content {
left: 0;
}
.layui-layout-admin .layui-body .layui-tab-item.layui-show {
border-top: 1px solid #e2e2e2;
}
.layuimini-all .layui-layout-left.layuimini-header-menu {
left: 15px !important
}
.layuimini-mini .layui-layout-left.layuimini-header-menu {
left: 205px !important
}
.layui-layout-admin .layui-nav.layui-layout-right > li:not(.layuimini-setting) {
width: 40px !important;
}
.layui-layout-admin .layui-nav.layui-layout-right > li:not(.layuimini-setting) a {
padding: 0 15px;
}
.layuimini-all .layui-layout-admin .layui-body {
left: 0px !important;
}
.layuimini-mini .layui-layout-admin .layuimini-menu-left, .layuimini-mini .layui-header .layuimini-logo {
left: 0;
transition: left .2s;
z-index: 1001 !important;
}
.layuimini-all .layui-layout-admin .layuimini-menu-left, .layuimini-all .layui-header .layuimini-logo {
left: -200px;
transition: left .2s;
top: 0;
z-index: 1002;
}
.layuimini-mini .layui-layout-admin .layui-body {
left: 0 !important;
transition: left .2s;
top: 0;
z-index: 998;
}
.layuimini-mini .layuimini-make {
display: block;
}
.layuimini-multi-module .layuimini-header-content .layuimini-tool {
display: none;
}
.layuimini-single-module .layuimini-header-content .layuimini-tool {
left: 15px;
}
.layuimini-mini .layuimini-site-mobile {
display: none !important;
}
.layuimini-site-mobile {
display: block !important;
position: fixed;
z-index: 100000;
bottom: 15px;
left: 15px;
width: 40px;
height: 40px;
line-height: 40px;
border-radius: 2px;
text-align: center;
background-color: rgba(0, 0, 0, .7);
color: #fff;
}
.layuimini-header-content {
z-index: 997;
}
/*修复UC之类的浏览器点击无效*/
.layuimini-make {
cursor: pointer;
}
.layuimini-site-mobile {
cursor: pointer;
}
}
@media screen and (max-width: 550px) {
/**头部右侧数据*/
.layuimini-multi-module.layuimini-mini .layuimini-header-content .layui-layout-right {
display: none;
}
}

98
target/classes/static/css/public.css

@ -1,98 +0,0 @@
body {
background: #f2f2f2;
}
.layuimini-container {
border: 1px solid #f2f2f2;
border-radius: 5px;
background-color: #ffffff
}
.layuimini-main {
margin: 10px 10px 10px 10px;
}
/**必填红点 */
.layuimini-form > .layui-form-item > .required:after {
content: '*';
color: red;
position: absolute;
margin-left: 4px;
font-weight: bold;
line-height: 1.8em;
top: 6px;
right: 5px;
}
.layuimini-form > .layui-form-item > .layui-form-label {
width: 120px !important;
}
.layuimini-form > .layui-form-item > .layui-input-block {
margin-left: 150px !important;
}
.layuimini-form > .layui-form-item > .layui-input-block > tip {
display: inline-block;
margin-top: 10px;
line-height: 10px;
font-size: 10px;
color: #a29c9c;
}
/**搜索框*/
.layuimini-container .table-search-fieldset {
margin: 0;
border: 1px solid #e6e6e6;
padding: 10px 20px 5px 20px;
color: #6b6b6b;
}
/**自定义滚动条样式 */
::-webkit-scrollbar {
width: 6px;
height: 6px
}
::-webkit-scrollbar-track {
background-color: transparent;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius: 2em;
}
::-webkit-scrollbar-thumb {
background-color: #9c9da0;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius: 2em
}
.my-shadow:hover {
box-shadow: 2px 0 4px rgba(0, 21, 41, .35);
}
.my-card {
cursor: pointer;
width: 100%;
display: inline-block;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.my-card-context{
margin-left: 15px;
font-size: 18px;
margin-top: 5px;
font-weight:normal;
}
.my-time {
margin-top: 40px;
margin-bottom: 20px;
}
body {
font-family: 华文楷体;
font-weight: bold;
}

95
target/classes/static/css/themes/default.css

@ -1,95 +0,0 @@
/*头部右侧背景色 headerRightBg */
.layui-layout-admin .layui-header {
background-color: #ffffff !important;
}
/*头部右侧选中背景色 headerRightBgThis */
.layui-layout-admin .layui-header .layuimini-header-content > ul > .layui-nav-item.layui-this, .layuimini-tool i:hover {
background-color: #e4e4e4 !important;
}
/*头部右侧字体颜色 headerRightColor */
.layui-layout-admin .layui-header .layui-nav .layui-nav-item a {
color: rgba(107, 107, 107, 0.7);
}
/**头部右侧下拉字体颜色 headerRightChildColor */
.layui-layout-admin .layui-header .layui-nav .layui-nav-item .layui-nav-child a {
color: rgba(107, 107, 107, 0.7) !important;
}
/*头部右侧鼠标选中 headerRightColorThis */
.layui-header .layuimini-menu-header-pc.layui-nav .layui-nav-item a:hover, .layui-header .layuimini-header-menu.layuimini-pc-show.layui-nav .layui-this a {
color: #565656 !important;
}
/*头部右侧更多下拉颜色 headerRightNavMore */
.layui-header .layui-nav .layui-nav-more {
border-top-color: rgba(160, 160, 160, 0.7) !important;
}
/*头部右侧更多下拉颜色 headerRightNavMore */
.layui-header .layui-nav .layui-nav-mored, .layui-header .layui-nav-itemed > a .layui-nav-more {
border-color: transparent transparent rgba(160, 160, 160, 0.7) !important;
}
/**头部右侧更多下拉配置色 headerRightNavMoreBg headerRightNavMoreColor */
.layui-header .layui-nav .layui-nav-child dd.layui-this a, .layui-header .layui-nav-child dd.layui-this, .layui-layout-admin .layui-header .layui-nav .layui-nav-item .layui-nav-child .layui-this a {
background-color: #1E9FFF !important;
color: #ffffff !important;
}
/*头部缩放按钮样式 headerRightToolColor */
.layui-layout-admin .layui-header .layuimini-tool i {
color: #565656;
}
/*logo背景颜色 headerLogoBg */
.layui-layout-admin .layuimini-logo {
background-color: #192027 !important;
}
/*logo字体颜色 headerLogoColor */
.layui-layout-admin .layuimini-logo h1 {
color: rgb(191, 187, 187);
}
/*左侧菜单更多下拉样式 leftMenuNavMore */
.layuimini-menu-left .layui-nav .layui-nav-more, .layuimini-menu-left-zoom.layui-nav .layui-nav-more {
border-top-color: rgb(191, 187, 187);
}
/*左侧菜单更多下拉样式 leftMenuNavMore */
.layuimini-menu-left .layui-nav .layui-nav-mored, .layuimini-menu-left .layui-nav-itemed > a .layui-nav-more, .layuimini-menu-left-zoom.layui-nav .layui-nav-mored, .layuimini-menu-left-zoom.layui-nav-itemed > a .layui-nav-more {
border-color: transparent transparent rgb(191, 187, 187) !important;
}
/*左侧菜单背景 leftMenuBg */
.layui-side.layui-bg-black, .layui-side.layui-bg-black > .layuimini-menu-left > ul, .layuimini-menu-left-zoom > ul {
background-color: #28333E !important;
}
/*左侧菜单选中背景 leftMenuBgThis */
.layuimini-menu-left .layui-nav-tree .layui-this, .layuimini-menu-left .layui-nav-tree .layui-this > a, .layuimini-menu-left .layui-nav-tree .layui-nav-child dd.layui-this, .layuimini-menu-left .layui-nav-tree .layui-nav-child dd.layui-this a, .layuimini-menu-left-zoom.layui-nav-tree .layui-this, .layuimini-menu-left-zoom.layui-nav-tree .layui-this > a, .layuimini-menu-left-zoom.layui-nav-tree .layui-nav-child dd.layui-this, .layuimini-menu-left-zoom.layui-nav-tree .layui-nav-child dd.layui-this a {
background-color: #1E9FFF !important
}
/*左侧菜单子菜单背景 leftMenuChildBg */
.layuimini-menu-left .layui-nav-itemed > .layui-nav-child {
background-color: #0c0f13 !important;
}
/*左侧菜单字体颜色 leftMenuColor */
.layuimini-menu-left .layui-nav .layui-nav-item a, .layuimini-menu-left-zoom.layui-nav .layui-nav-item a {
color: rgb(191, 187, 187) !important;
}
/*左侧菜单选中字体颜色 leftMenuColorThis */
.layuimini-menu-left .layui-nav .layui-nav-item a:hover, .layuimini-menu-left .layui-nav .layui-this a, .layuimini-menu-left-zoom.layui-nav .layui-nav-item a:hover, .layuimini-menu-left-zoom.layui-nav .layui-this a {
color: #ffffff !important;
}
/**tab选项卡选中颜色 tabActiveColor */
.layuimini-tab .layui-tab-title .layui-this .layuimini-tab-active {
background-color: #1e9fff;
}

BIN
target/classes/static/images/bg.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save