Browse Source

添加出库记录修改功能

lwx_dev
erdanergou 3 years ago
parent
commit
b894abda46
  1. 40
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java
  2. 22
      src/main/java/com/dreamchaser/depository_manage/controller/PageController.java
  3. 6
      src/main/java/com/dreamchaser/depository_manage/entity/ExcelInfo.java
  4. 6
      src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java
  5. 250
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  6. 1
      src/main/java/com/dreamchaser/depository_manage/service/impl/ExcelServiceImpl.java
  7. 3
      src/main/java/com/dreamchaser/depository_manage/service/impl/SplitUnitServiceImpl.java
  8. 21
      src/main/java/com/dreamchaser/depository_manage/utils/DateUtil.java
  9. BIN
      src/main/resources/static/upload/materialImport.xlsx
  10. 2
      src/main/resources/templates/pages/application/form-step-look_back.html
  11. 190
      src/main/resources/templates/pages/application/form-step-look_minRecordOut.html
  12. 17
      src/test/java/com/dreamchaser/depository_manage/TestForOther.java
  13. BIN
      target/classes/static/upload/materialImport.xlsx
  14. 6
      target/classes/templates/pages/application/application-out_min.html
  15. 2
      target/classes/templates/pages/application/form-step-look_back.html
  16. 190
      target/classes/templates/pages/application/form-step-look_minRecordOut.html
  17. 18
      target/classes/templates/pages/company/company-out.html
  18. 19
      target/classes/templates/pages/post/post-out.html

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

@ -900,7 +900,7 @@ public class DepositoryRecordController {
redisTemplateForHash.opsForList().remove("depositoryIds" + userToken.getId(), 1, depositoryId.toString());
}
for (String placeCode : placeCodes) {
redisTemplateForHash.opsForList().remove("placeCodes" + userToken.getId(), 1, placeCode+" ");
redisTemplateForHash.opsForList().remove("placeCodes" + userToken.getId(), 1, placeCode + " ");
}
return CrudUtil.insertHandle(1, 1);
}
@ -1565,5 +1565,43 @@ public class DepositoryRecordController {
}
}
// 用于获取当前出库子单下物料详细信息
@PostMapping("/getOutMinRecordMaterialInfo")
public RestResponse getOutMinRecordMaterialInfo(@RequestBody Map<String, Object> params) {
Inventory inventory = null;
if (params.containsKey("id")) {
// 获取子单详情
ApplicationOutRecordMinP outRecordMinP = depositoryRecordService.findApplicationOutMinById(ObjectFormatUtil.toInteger(params.get("id")));
inventory = materialService.findInventoryById(outRecordMinP.getMid());
List<SplitInfo> splitInfoByMid = splitUnitService.findSplitInfoByMid(inventory.getMid());
inventory.setSplitInfoList(splitInfoByMid);
}
return new RestResponse(inventory);
}
/**
* 用于修改当前出库的子订单信息
*
* @param map
* @return
*/
@PostMapping("/editOutMinRecordInfo")
public RestResponse editOutMinRecordInfo(@RequestBody Map<String, Object> map, HttpServletRequest request) {
if (map.containsKey("id")) {
String token = request.getHeader("user-token");
if (token == null) {
token = (String) request.getSession().getAttribute("userToken");
}
UserByPort userToken = AuthenticationTokenPool.getUserToken(token);
String header = request.getHeader("user-agent");
String crypt = Md5.crypt(header);
Integer integer = depositoryRecordService.updateOutMinRecordInfo(map, userToken, crypt);
return CrudUtil.updateHandle(integer,1);
} else {
throw new MyException("缺少必要参数");
}
}
}

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

@ -1636,7 +1636,9 @@ public class PageController {
int scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1);
sumUnit.append(unit).append(",");
if (inventoryById.getPrice() != null) {
sumPrice += (inventoryById.getPrice() / scale * applicationOutRecordMin.getQuantity());
BigDecimal bd = BigDecimal.valueOf((inventoryById.getPrice() / scale * applicationOutRecordMin.getQuantity()));
double v = bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
sumPrice += v;
} else {
sumPrice += 0;
}
@ -1898,6 +1900,24 @@ public class PageController {
Depository depositoryById = depositoryService.findDepositoryById(transferRecord.getToId());
mv.addObject("toLocation", depositoryById.getDname() + "-" + place.getCode());
}
// 获取当前主单
ApplicationOutRecordP recordP = depositoryRecordService.findApplicationOutRecordPById(recordMinP.getParentId());
boolean b = DateUtil.IsMonthStartAndEnd(recordP.getApplicantTime());
Integer role = userToken.getIsadmin();
if(role == null){
role = 1;
}
if (Integer.compare(userToken.getMaindeparment(), 361) == 0 || Integer.compare(role, 4) == 0 && b) {
mv.addObject("edisplay", "inline-block");
}else{
mv.addObject("edisplay", "none");
}
mv.addObject("recordMinP", recordMinP);
} else {
throw new MyException("缺少必要参数!");

6
src/main/java/com/dreamchaser/depository_manage/entity/ExcelInfo.java

@ -55,4 +55,10 @@ public class ExcelInfo {
/** 材质 */
@ExcelProperty("材质")
private String texture;
/**
* 品牌
*/
@ExcelProperty("品牌")
private String brand;
}

6
src/main/java/com/dreamchaser/depository_manage/service/DepositoryRecordService.java

@ -557,4 +557,10 @@ public interface DepositoryRecordService {
*/
RestResponse updateOutSplitInventoryInfo(SplitInfo splitInfo, MaterialAndPlace materialAndPlace, double quantity, double nowQuantity, SplitInfo realSplitInfo);
/**
* 用于修改出库子记录
* @param map 待修改数据
* @return
*/
Integer updateOutMinRecordInfo(Map<String,Object> map,UserByPort userToken,String userAgent);
}

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

@ -722,7 +722,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
flagForApproval = false;
}
}
if(map.containsKey("isGroup")){
if (map.containsKey("isGroup")) {
flagForApproval = isApprovalPass;
}
map.put("flagForApproval", flagForApproval);
@ -1120,14 +1120,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}
}
}).start();
}
else {
} else {
restResponse.setStatus(508);
restResponse.setData("");
restResponse.setStatusInfo(new StatusInfo("出库失败", "出库失败,库存不足"));
}
}
else {
} else {
// 如果是拆单后的出库
// 用于获取对应的拆单记录
@ -1191,8 +1189,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
restResponse.setStatusInfo(new StatusInfo("出库成功", "出库成功"));
}
else {
} else {
// 如果不能满足需求
// 获取对应的拆单记录
@ -1218,7 +1215,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
splitUnitMapper.updateSplitInventory(splitInventory);
// 获取当前父级拆单记录
SplitInfo parentSplitInfo = splitUnitMapper.findSplitInfoById(splitInfoById.getParentId());
@ -1235,17 +1231,16 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
map.put("unit", applicationOutMinById.getUnit());
transferMaterial(map);
}
}else{
} else {
trueOut = 0.0;
splitInventory.setSaveQuantity((int)(oldSplitInventory * 100));
splitInventory.setOutQuantity(splitInventory.getOutQuantity() - (int)(oldSplitInventory * 100));
splitInventory.setSaveQuantity((int) (oldSplitInventory * 100));
splitInventory.setOutQuantity(splitInventory.getOutQuantity() - (int) (oldSplitInventory * 100));
// 修改库存数量
splitUnitMapper.updateSplitInventory(splitInventory);
}
updateApplicationMinOutInfo(id, applicationOutMinById, record, trueOut, userByPort, placeId, userAgent);
}
else {
} else {
// 如果当前拆单没有父级
@ -1330,8 +1325,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
restResponse.setData("");
restResponse.setStatusInfo(new StatusInfo("出库失败", "出库失败,库存不足"));
}
}
else {
} else {
// 如果大于
// 获取库存重要减少的数量
@ -1365,8 +1359,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 如果当前库存中的物料库存不足以出库
flag = false;
}
}
else {
} else {
restResponse.setStatus(566);
restResponse.setData("");
restResponse.setStatusInfo(new StatusInfo("出库失败", "当前位置未发现该物料"));
@ -1420,8 +1413,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}
}
}
else {
} else {
// 如果拆单库存处理记录不存在
int scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1);
@ -1489,8 +1481,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
restResponse.setStatusInfo(new StatusInfo("出库成功", "出库成功"));
}
else {
} else {
restResponse.setStatus(508);
restResponse.setData("");
restResponse.setStatusInfo(new StatusInfo("出库失败", "出库失败,库存不足"));
@ -1546,8 +1537,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
restResponse.setStatus(200);
restResponse.setData("");
restResponse.setStatusInfo(new StatusInfo("出库成功", "出库成功"));
}
else {
} else {
// 如果当前库存拆单记录的库存不能满足需要
@ -1621,8 +1611,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
restResponse.setData("");
restResponse.setStatusInfo(new StatusInfo("出库成功", "出库成功"));
}
else {
} else {
// 如果当前当前父级与其的库存数量不大于要出库的数量
if (parentSplitInfo.getParentId() != null) {
@ -1671,8 +1660,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
} else {
return restResponse1;
}
}
else {
} else {
// 如果没有父级
// 获取当前拆单单位与顶级之间的进制
@ -1701,8 +1689,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
placeMapper.updateMaterialAndPlace(materialAndPlace);
}
else {
} else {
// 如果不可出库
restResponse.setStatus(508);
restResponse.setData("");
@ -1711,8 +1698,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}
}
}
else {
} else {
// 如果已经没有父级
// 获取基础单位与当前实际出库单位单位之间的进制
@ -1723,23 +1709,23 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 获取对应的库存
Inventory inventory = materialMapper.findInventoryById(materialAndPlace.getMid());
if(surplus_redundant == 0) {
if (surplus_redundant == 0) {
surplus_redundant = 1;
}
// 设置当前库存数量
materialAndPlace.setQuantity(materialAndPlace.getQuantity() - surplus_redundant * 100);
inventory.setQuantity(inventory.getQuantity() - surplus_redundant * 100);
// 设置当前库存数量
materialAndPlace.setQuantity(materialAndPlace.getQuantity() - surplus_redundant * 100);
inventory.setQuantity(inventory.getQuantity() - surplus_redundant * 100);
// 修改库存数量
materialMapper.updateInventory(inventory);
placeMapper.updateMaterialAndPlace(materialAndPlace);
Map<String,Object> insertForOut = new HashMap<>();
insertForOut.put("unit",realSplitInfo.getNewUnit());
insertForOut.put("quantity",surplus_redundant * splitInfoScaleQuantityForAll - nowQuantity);
insertForOut.put("placeId",materialAndPlace.getPid());
insertForOut.put("depositoryId",materialAndPlace.getDid());
Map<String, Object> insertForOut = new HashMap<>();
insertForOut.put("unit", realSplitInfo.getNewUnit());
insertForOut.put("quantity", surplus_redundant * splitInfoScaleQuantityForAll - nowQuantity);
insertForOut.put("placeId", materialAndPlace.getPid());
insertForOut.put("depositoryId", materialAndPlace.getDid());
insertForOut.put("mid", inventory.getMid());
insertForOut.put("mcode", inventory.getCode());
insertForOut.put("type", "in");
@ -1751,8 +1737,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
restResponse.setData(surplus_redundant);
}
}
else {
} else {
// 如果不能满足需求
restResponse.setStatus(508);
@ -1763,6 +1748,167 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
return restResponse;
}
/**
* 用于修改出库子记录
*
* @param map 待修改数据
* @return
*/
@Override
public Integer updateOutMinRecordInfo(Map<String, Object> map, UserByPort userToken, String userAgent) {
Integer result = 0;
Integer id = ObjectFormatUtil.toInteger(map.get("id"));
// 获取更改的数量
Double quantity = ObjectFormatUtil.toDouble(map.get("quantity"));
// 获取出库子记录信息
ApplicationOutRecordMin outRecordMin = depositoryRecordMapper.findApplicationOutMinById(id);
// 获取出库主记录
ApplicationOutRecord outRecord = depositoryRecordMapper.findApplicationOutRecordPById(outRecordMin.getParentId());
// 获取已出库的数量
Integer trueOut = outRecordMin.getTrueOut();
// 获取要出库的数量
Integer outQuantity = outRecordMin.getQuantity();
// 获取出库的单位
String unit = outRecordMin.getUnit();
// 获取库存记录
Inventory inventoryById = materialMapper.findInventoryById(outRecordMin.getMid());
if (Integer.compare(trueOut, 0) != 0) {
// 如果是开始出库的
if (trueOut >= (int) (quantity * 100)) {
// 如果已经出库的数量大于要修改的数量
// 如果已经完成了出库
// 获取要退库的数量
double returnQuantity = (double) (trueOut / 100) - quantity;
// 获取出库库位
Place placeById = placeMapper.findPlaceById(outRecordMin.getPlaceId());
// 用于获取映射关系
Map<String, Object> paramForPlaceAndMaterial = new HashMap<>();
paramForPlaceAndMaterial.put("mid", placeById.getId());
paramForPlaceAndMaterial.put("iid", inventoryById.getId());
// 获取库存与库存之间的映射
MaterialAndPlace placeAndMaterialByMidAndPid = placeMapper.findPlaceAndMaterialByMidAndPid(paramForPlaceAndMaterial);
if ("-1".equals(unit)) {
// 如果是基础单位
// 设置库存数量
inventoryById.setQuantity(inventoryById.getQuantity() + (int) (returnQuantity * 100));
// 设置库位数量
placeById.setQuantity(placeById.getQuantity() + (int) (returnQuantity * 100));
// 设置新映射数量
placeAndMaterialByMidAndPid.setQuantity(placeAndMaterialByMidAndPid.getQuantity() + (int) (returnQuantity * 100));
// 修改
materialMapper.updateInventory(inventoryById);
placeMapper.updateMaterialAndPlace(placeAndMaterialByMidAndPid);
placeMapper.UpdatePlace(placeById);
} else {
// 如果是拆单
Map<String, Object> paramForSplitInfo = new HashMap<>();
paramForSplitInfo.put("mid", inventoryById.getMid());
paramForSplitInfo.put("newUnit", unit);
// 获取拆单记录
SplitInfo splitInfo = splitUnitMapper.findSplitInfoByMidAndUnit(paramForSplitInfo);
Map<String, Object> paramForSplitInventory = new HashMap<>();
paramForSplitInventory.put("sid", splitInfo.getId());
paramForSplitInventory.put("iid", placeAndMaterialByMidAndPid.getId());
// 获取拆单库存记录
SplitInventory splitInventory = splitUnitMapper.findSplitInventoryByIidAndSid(paramForSplitInventory);
Map<String, Object> paramForUpdateSplitInventory = new HashMap<>();
paramForUpdateSplitInventory.put("placeId", outRecordMin.getPlaceId());
paramForUpdateSplitInventory.put("depositoryId", outRecordMin.getDepositoryId());
paramForUpdateSplitInventory.put("quantity", returnQuantity);
paramForUpdateSplitInventory.put("mid", inventoryById.getMid());
paramForUpdateSplitInventory.put("unit", unit);
result = splitUnitService.realInInventoryToDepository(returnQuantity, splitInventory, paramForUpdateSplitInventory, splitInfo, placeAndMaterialByMidAndPid, false);
if (paramForUpdateSplitInventory.containsKey("applicationInId")) {
depositoryRecordMapper.deleteApplicationInRecordById(ObjectFormatUtil.toInteger(paramForUpdateSplitInventory.get("applicationInId")));
}
}
// 修改子单数据
outRecordMin.setQuantity((int) (quantity * 100));
outRecordMin.setTrueOut((int) (quantity * 100));
depositoryRecordMapper.updateApplicationOutRecordMin(outRecordMin);
if (Integer.compare(trueOut, outQuantity) != 0) {
//如果没有完成出库
// 强行完成出库
updateApplicationMinOutInfo(id, outRecordMin, outRecord, (double) (quantity / 100), userToken, placeById.getId(), userAgent);
}
} else {
// 如果不大于
// 设置新数量
outRecordMin.setQuantity((int) (quantity * 100));
// 修改记录
result = depositoryRecordMapper.updateApplicationOutRecordMin(outRecordMin);
}
} else {
// 如果未开始出库的
// 设置新数量
outRecordMin.setQuantity((int) (quantity * 100));
// 修改记录
result = depositoryRecordMapper.updateApplicationOutRecordMin(outRecordMin);
}
// 修改主记录的出库数量
outRecord.setQuantity(outRecord.getQuantity() - outQuantity + (int) (quantity * 100));
if ("-1".equals(unit)) {
// 如果是基础单位
if (inventoryById.getPrice() != null) {
outRecord.setPrice(outRecord.getPrice() - inventoryById.getPrice() * (outQuantity / 100) + inventoryById.getPrice() * quantity);
}
} else {
// 如果是拆单单位
if (inventoryById.getPrice() != null) {
Map<String, Object> paramForSplitInfo = new HashMap<>();
paramForSplitInfo.put("mid", inventoryById.getMid());
paramForSplitInfo.put("newUnit", unit);
// 获取拆单记录
SplitInfo splitInfo = splitUnitMapper.findSplitInfoByMidAndUnit(paramForSplitInfo);
// 获取当前拆单单位与基础单位的进制
int splitInfoScaleQuantity = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1);
double newPrice = inventoryById.getPrice() / splitInfoScaleQuantity;
BigDecimal bg = new BigDecimal(newPrice);
newPrice = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
outRecord.setPrice(outRecord.getPrice() - (newPrice * (outQuantity / 100) ) + newPrice * quantity);
}
}
return result;
}
/**
* 用于完成出库时的相关处理操作
*
@ -2007,7 +2153,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}
//设置子订单在redis中的主键
String minRecordKey = "minRecord:" + applicationOutRecordMin.getId();
// 将子订单主键插入到主订单的子订单列表
@ -2072,8 +2217,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
JSONObject jsonObject = qyWxOperationService.sendNotificationToDepositoryManager(QyWxUid.toString(), applicationOutRecordMin.getId(), userAgent);
}
}).start();
}
else{
} else {
// 如果是通过仓库
@ -2127,7 +2271,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
}
}
// 将主订单插入到redis中
@ -2158,8 +2301,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
// 将当前redis中存储的spno删除
redisTemplate.delete(spNo);
}
}
else {
} else {
// 如果是部门负责人
String departmentheadTime = recordP.getDepartmentheadTime();
@ -2535,7 +2677,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
UserByPort applicantUser = LinkInterfaceUtil.FindUserById(record.getApplicantId(), userToken);
if (map.containsKey("departmentheadPass") && !flagForHasOtherDepository && Integer.compare(applicantUser.getMaindeparment(),361) != 0) {
if (map.containsKey("departmentheadPass") && !flagForHasOtherDepository && Integer.compare(applicantUser.getMaindeparment(), 361) != 0) {
String result = "";
String simpleTime = DateUtil.getSimpleTime(new Date());
map.put("departmentheadTime", DateUtil.DateTimeToTimeStamp(simpleTime));
@ -2615,8 +2757,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
qyWxOperationService.sendMessageForOtherUserByCard(ObjectFormatUtil.toInteger(id), s, userAgent, 1);
}
}).start();
}
else {
} else {
String result = "";
// 开启线程更改其他用户卡片模板样式
String simpleTime = DateUtil.getSimpleTime(new Date());
@ -2672,7 +2813,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
minRecord.put("state", "1"); // 当前子订单状态 1待处理2处理
// 获取出库仓库
Integer depositoryId = applicationOutRecordMin.getDepositoryId();
Depository depositoryById = depositoryMapper.findDepositoryById(depositoryId);
@ -2736,8 +2876,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
JSONObject jsonObject = qyWxOperationService.sendNotificationToDepositoryManager(QyWxUid.toString(), applicationOutRecordMin.getId(), userAgent);
}
}).start();
}
else{
} else {
// 如果是通过仓库
@ -2825,8 +2964,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
map.put("departmentheadPass", 1);
}
}
else {
} else {
updateInventoryForOutRefused(record);
result = "驳回";
map.put("pass", 2);

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

@ -114,6 +114,7 @@ public class ExcelServiceImpl implements ExcelService {
param.put("texture", excelVo.getTexture());
param.put("materialTypeId", excelVo.getTypeId());
param.put("id", excelVo.getId());
param.put("brand", excelVo.getBrand());
param.put("price", excelVo.getPrice() == null ? "0" : excelVo.getPrice());
materialService.insertMaterial(param);
success.add(excelVo);

3
src/main/java/com/dreamchaser/depository_manage/service/impl/SplitUnitServiceImpl.java

@ -142,7 +142,8 @@ public class SplitUnitServiceImpl implements SplitUnitService {
// 查询当前库存是否有该拆单的处理记录
splitInventory = splitUnitMapper.findSplitInventoryByIidAndSid(paramForInsertSplitInventory);
}
} else {
}
else {
Map<String, Object> param = new HashMap<>();
param.put("depositoryId", map.get("depositoryId"));
param.put("mid", map.get("mid"));

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

@ -203,4 +203,25 @@ public class DateUtil {
return (cal.getTimeInMillis() - System.currentTimeMillis()) / 1000;
}
/**
* 用于判断当前日期是否在当月内
* @param time 待查询日期
* @return
*/
public static boolean IsMonthStartAndEnd(String time) {
// 获取当前年份、月份、日期
Calendar cale = null;
// 第一天
cale = Calendar.getInstance();
cale.add(Calendar.MONTH, 0);
cale.set(Calendar.DAY_OF_MONTH, 1);
Date firstDay = cale.getTime();
// 最后一天
cale = Calendar.getInstance();
cale.add(Calendar.MONTH, 1);
cale.set(Calendar.DAY_OF_MONTH, 0);
Date lastDay = cale.getTime();
return Long.parseLong(time) >= firstDay.getTime() && Long.parseLong(time) <= lastDay.getTime();
}
}

BIN
src/main/resources/static/upload/materialImport.xlsx

Binary file not shown.

2
src/main/resources/templates/pages/application/form-step-look_back.html

@ -19,6 +19,7 @@
<div id="stepForm" lay-filter="stepForm" style="margin: 0 auto;">
<div style="margin-top: 30px">
<button th:style="'display:'+${display}" onclick="downloadExcel()">下载</button>
<table id="demo" class="layui-table"
style="margin: 0 auto;max-width: 800px;">
<colgroup>
@ -137,6 +138,7 @@
function downloadExcel(){
}
layui.use(['form', 'step'], function () {
var $ = layui.$,
form = layui.form,

190
src/main/resources/templates/pages/application/form-step-look_minRecordOut.html

@ -18,6 +18,8 @@
<div class="layui-card-body" style="padding-top: 40px;">
<div id="stepForm" lay-filter="stepForm" style="margin: 0 auto;">
<div style="margin-top: 30px">
<button th:style="'display:'+${edisplay}" onclick="modifyPage()" id="editInfo">编辑</button>
<input id="id" type="text" th:value="${recordMinP.getId()}" readonly style="display: none">
<table id="demo" class="layui-table"
style="margin: 0 auto;max-width: 800px;padding-top: 40px;">
<colgroup>
@ -28,54 +30,101 @@
<tbody>
<tr>
<td>申请编号</td>
<td id="applicationId" th:text="${recordMinP.getCode()}">123456</td>
<td>
<input id="applicationOutCode" type="text" th:value="${recordMinP.getCode()}"
readonly style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>物料名称</td>
<td id="materialName" th:text="${recordMinP.getMname()}">骁龙888芯片</td>
<td>
<input id="materialName" type="text" th:value="${recordMinP.getMname()}"
readonly style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>物料型号</td>
<td id="version" th:text="${recordMinP.getVersion()}">骁龙888芯片</td>
<td>
<input id="version" type="text" th:value="${recordMinP.getVersion()}" readonly
style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>存货编码</td>
<td id="mcode" th:text="${recordMinP.getMcode()}">外芯仓库</td>
<td>
<input id="mcode" type="text" th:value="${recordMinP.getMcode()}" readonly
style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>数量</td>
<td id="quantity" th:text="${recordMinP.getQuantity()}">409</td>
<td>
<input id="quantity" type="text" th:value="${recordMinP.getQuantity()}" readonly
style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>单位</td>
<td id="unit" th:text="${recordMinP.getUnit()}">409</td>
<td>
<select id="unit" name="unit" style="border-style: none; width: 100%;">
<option th:value="-1" th:text="${recordMinP.getUnit()}"></option>
</select>
</td>
</tr>
<tr>
<td>金额</td>
<td id="price" th:text="${recordMinP.getPrice()}">2016-11-28</td>
<td>
<input id="price" type="text" th:value="${recordMinP.getPrice()}" readonly
style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>仓库名称</td>
<td id="depositoryName" th:text="${recordMinP.getDepositoryName()}">外芯仓库</td>
<td>
<input id="depositoryName" type="text"
th:value="${recordMinP.getDepositoryName()}" readonly
style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>库位编码</td>
<td id="placeCode" th:text="${recordMinP.getPlaceCode() =='0000'?'默认库位':recordMinP.getPlaceCode()}">外芯仓库</td>
<td>
<input id="placeCode" type="text"
th:value="${recordMinP.getPlaceCode() =='0000'?'默认库位':recordMinP.getPlaceCode()}"
readonly style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr th:style="'display:'+${display}">
<tr th:style="'display:'+${display}">
<td>转入位置</td>
<td id="location" th:text="${toLocation}">2016-11-28</td>
<td>
<input id="location" type="text" th:value="${toLocation}" readonly
style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>出库人员</td>
<td id="checkerName" th:text="${recordMinP.getCheckerName()}">2016-11-28</td>
<td>
<input id="checkerName" type="text" th:value="${recordMinP.getCheckerName()}"
readonly style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
</tbody>
</table>
<div id="btn_show" style=" margin-top: 20px;position: relative;left: 40%; display:none;">
<button type="button" class="layui-btn layui-btn-primary layui-border-blue"
onclick="editOutRecord()">确定
</button>
<button type="button" class="layui-btn layui-btn-primary layui-border-red"
onclick="unEdit()">取消
</button>
</div>
</div>
</div>
</div>
@ -87,6 +136,123 @@
<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 modifyPage() {
}
function unEdit() {
}
function editOutRecord() {
}
let flagForForm = false;
layui.use(['form', 'step'], function () {
var $ = layui.$,
form = layui.form,
step = layui.step;
// 获取实际出库数量
let quantity = $("#quantity").val();
let unit = $("#unit").text();
let id = $("#id").val();
modifyPage = function () {
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
$.ajax({
url: "/depositoryRecord/getOutMinRecordMaterialInfo",
type: "POST",
data: JSON.stringify({"id": id}),
dataType: 'json',
contentType: "application/json;charset=utf-8",
success: function (res) {
let data = res.data;
if (data !== null) {
let quantityItem = $("#quantity");
quantityItem.removeAttr("readonly");
quantityItem.focus();
// let splitInfoList = data["splitInfoList"];
// if (splitInfoList !== null) {
// let unitItem = $("#unit");
// unitItem.empty();
// unitItem.append(new Option(data.unit, "-1"));
// $.each(splitInfoList, function (index, item) {
// unitItem.append(new Option(item.newUnit, item.newUnit));
// });
// }
}
$("#btn_show").show();
$("#editInfo").hide();
layer.close(loading2);
}
})
};
unEdit = function () {
$("#btn_show").hide();
$("#editInfo").show();
$("#quantity").attr("readonly", "readonly");
$("#quantity").val(quantity);
// $("#unit").empty();
// $("#unit").append(new Option(unit, "-1"))
};
editOutRecord = function () {
if (!flagForForm) {
flagForForm = true;
let req = {};
req.id = id;
let newQuantity = $("#quantity").val();
if (Number(newQuantity) >= Number(quantity)) {
layer.msg("请申请!", {
icon: 0,
time: 1000
}, function () {
unEdit();
})
} else {
req.quantity = newQuantity;
req.unit = $("#unit").val();
$.ajax({
url: "/depositoryRecord/editOutMinRecordInfo",
type: "POST",
data: JSON.stringify(req),
dataType: 'json',
contentType: "application/json;charset=utf-8",
success: function (res) {
if (res.status === 205) {
layer.msg("修改成功", {
icon: 1,
time: 1000
}, function () {
var index = parent.layer.getFrameIndex(window.name);
parent.location.reload(); //刷新父页面
parent.layer.close(index);
})
} else {
layer.msg(res.statusInfo.detail, {
icon: 5,
time: 1000
}, function () {
flagForForm = false;
})
}
}
})
}
}
}
})
</script>
</body>
</html>

17
src/test/java/com/dreamchaser/depository_manage/TestForOther.java

@ -15,6 +15,7 @@ import com.dreamchaser.depository_manage.entity.*;
import com.dreamchaser.depository_manage.mapper.DepositoryMapper;
import com.dreamchaser.depository_manage.mapper.DepositoryRecordMapper;
import com.dreamchaser.depository_manage.mapper.MaterialMapper;
import com.dreamchaser.depository_manage.pojo.ApplicationOutRecordP;
import com.dreamchaser.depository_manage.pojo.RestResponse;
import com.dreamchaser.depository_manage.pojo.callBackXml.approvalCallBackXml.ApprovalInfo;
import com.dreamchaser.depository_manage.pojo.callBackXml.approvalCallBackXml.ApprovalInfo_Details;
@ -38,6 +39,7 @@ import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Array;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.*;
@ -60,6 +62,9 @@ public class TestForOther {
@Autowired
QyWxOperationService qyWxOperationService;
/**
* 获取当月的开始和结束时间
*/
@Test
@ -68,19 +73,13 @@ public class TestForOther {
// ApprovalInfo_Details_Approver approver = new ApprovalInfo_Details_Approver();
// approver.setUserId("PangFuZhen");
// approvalInfo.setApprover(approver);
List<String> a = new ArrayList<String>(Collections.singleton("1"));
// depositoryRecordService.reviewByQyWxApprovalOut("5",approvalInfo,"7a0ab47a150869808b24d2f4dbe1bb74","2","202303280016", false,2);
ApplicationOutRecordP applicationOutRecordPById = depositoryRecordService.findApplicationOutRecordPById(8);
// depositoryRecordService.reviewByQyWxApprovalOut("5",approvalInfo,"7a0ab47a150869808b24d2f4dbe1bb74","2","202303280016", false,2);
// depositoryRecordService.reviewByQyWxApprovalIn("[1]",approvalInfo,"460f46eaefb46bb0c171029f62e2cea6","2","202303220009");
// UserByPort userByPort = LinkInterfaceUtil.FindUserById(78, null);
// List<String> s = excelService.writeExcelForPrint(2, 4,userByPort);
// GetMonthStartAndEnd();
}
}

BIN
target/classes/static/upload/materialImport.xlsx

Binary file not shown.

6
target/classes/templates/pages/application/application-out_min.html

@ -90,12 +90,6 @@
page: true,
skin: 'line',
done: function (res, curr, count) {
var data = res.data;
if (data.length > 0) {
if (data[0].state === "进行中") {
$("[data-field='id']").css('display', 'none');
}
}
}

2
target/classes/templates/pages/application/form-step-look_back.html

@ -19,6 +19,7 @@
<div id="stepForm" lay-filter="stepForm" style="margin: 0 auto;">
<div style="margin-top: 30px">
<button th:style="'display:'+${display}" onclick="downloadExcel()">下载</button>
<table id="demo" class="layui-table"
style="margin: 0 auto;max-width: 800px;">
<colgroup>
@ -137,6 +138,7 @@
function downloadExcel(){
}
layui.use(['form', 'step'], function () {
var $ = layui.$,
form = layui.form,

190
target/classes/templates/pages/application/form-step-look_minRecordOut.html

@ -18,6 +18,8 @@
<div class="layui-card-body" style="padding-top: 40px;">
<div id="stepForm" lay-filter="stepForm" style="margin: 0 auto;">
<div style="margin-top: 30px">
<button th:style="'display:'+${edisplay}" onclick="modifyPage()" id="editInfo">编辑</button>
<input id="id" type="text" th:value="${recordMinP.getId()}" readonly style="display: none">
<table id="demo" class="layui-table"
style="margin: 0 auto;max-width: 800px;padding-top: 40px;">
<colgroup>
@ -28,54 +30,101 @@
<tbody>
<tr>
<td>申请编号</td>
<td id="applicationId" th:text="${recordMinP.getCode()}">123456</td>
<td>
<input id="applicationOutCode" type="text" th:value="${recordMinP.getCode()}"
readonly style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>物料名称</td>
<td id="materialName" th:text="${recordMinP.getMname()}">骁龙888芯片</td>
<td>
<input id="materialName" type="text" th:value="${recordMinP.getMname()}"
readonly style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>物料型号</td>
<td id="version" th:text="${recordMinP.getVersion()}">骁龙888芯片</td>
<td>
<input id="version" type="text" th:value="${recordMinP.getVersion()}" readonly
style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>存货编码</td>
<td id="mcode" th:text="${recordMinP.getMcode()}">外芯仓库</td>
<td>
<input id="mcode" type="text" th:value="${recordMinP.getMcode()}" readonly
style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>数量</td>
<td id="quantity" th:text="${recordMinP.getQuantity()}">409</td>
<td>
<input id="quantity" type="text" th:value="${recordMinP.getQuantity()}" readonly
style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>单位</td>
<td id="unit" th:text="${recordMinP.getUnit()}">409</td>
<td>
<select id="unit" name="unit" style="border-style: none; width: 100%;">
<option th:value="-1" th:text="${recordMinP.getUnit()}"></option>
</select>
</td>
</tr>
<tr>
<td>金额</td>
<td id="price" th:text="${recordMinP.getPrice()}">2016-11-28</td>
<td>
<input id="price" type="text" th:value="${recordMinP.getPrice()}" readonly
style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>仓库名称</td>
<td id="depositoryName" th:text="${recordMinP.getDepositoryName()}">外芯仓库</td>
<td>
<input id="depositoryName" type="text"
th:value="${recordMinP.getDepositoryName()}" readonly
style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>库位编码</td>
<td id="placeCode" th:text="${recordMinP.getPlaceCode() =='0000'?'默认库位':recordMinP.getPlaceCode()}">外芯仓库</td>
<td>
<input id="placeCode" type="text"
th:value="${recordMinP.getPlaceCode() =='0000'?'默认库位':recordMinP.getPlaceCode()}"
readonly style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr th:style="'display:'+${display}">
<tr th:style="'display:'+${display}">
<td>转入位置</td>
<td id="location" th:text="${toLocation}">2016-11-28</td>
<td>
<input id="location" type="text" th:value="${toLocation}" readonly
style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
<tr>
<td>出库人员</td>
<td id="checkerName" th:text="${recordMinP.getCheckerName()}">2016-11-28</td>
<td>
<input id="checkerName" type="text" th:value="${recordMinP.getCheckerName()}"
readonly style="border-style: none;width: 100%;height: 100%">
</td>
</tr>
</tbody>
</table>
<div id="btn_show" style=" margin-top: 20px;position: relative;left: 40%; display:none;">
<button type="button" class="layui-btn layui-btn-primary layui-border-blue"
onclick="editOutRecord()">确定
</button>
<button type="button" class="layui-btn layui-btn-primary layui-border-red"
onclick="unEdit()">取消
</button>
</div>
</div>
</div>
</div>
@ -87,6 +136,123 @@
<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 modifyPage() {
}
function unEdit() {
}
function editOutRecord() {
}
let flagForForm = false;
layui.use(['form', 'step'], function () {
var $ = layui.$,
form = layui.form,
step = layui.step;
// 获取实际出库数量
let quantity = $("#quantity").val();
let unit = $("#unit").text();
let id = $("#id").val();
modifyPage = function () {
let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0});
$.ajax({
url: "/depositoryRecord/getOutMinRecordMaterialInfo",
type: "POST",
data: JSON.stringify({"id": id}),
dataType: 'json',
contentType: "application/json;charset=utf-8",
success: function (res) {
let data = res.data;
if (data !== null) {
let quantityItem = $("#quantity");
quantityItem.removeAttr("readonly");
quantityItem.focus();
// let splitInfoList = data["splitInfoList"];
// if (splitInfoList !== null) {
// let unitItem = $("#unit");
// unitItem.empty();
// unitItem.append(new Option(data.unit, "-1"));
// $.each(splitInfoList, function (index, item) {
// unitItem.append(new Option(item.newUnit, item.newUnit));
// });
// }
}
$("#btn_show").show();
$("#editInfo").hide();
layer.close(loading2);
}
})
};
unEdit = function () {
$("#btn_show").hide();
$("#editInfo").show();
$("#quantity").attr("readonly", "readonly");
$("#quantity").val(quantity);
// $("#unit").empty();
// $("#unit").append(new Option(unit, "-1"))
};
editOutRecord = function () {
if (!flagForForm) {
flagForForm = true;
let req = {};
req.id = id;
let newQuantity = $("#quantity").val();
if (Number(newQuantity) >= Number(quantity)) {
layer.msg("请申请!", {
icon: 0,
time: 1000
}, function () {
unEdit();
})
} else {
req.quantity = newQuantity;
req.unit = $("#unit").val();
$.ajax({
url: "/depositoryRecord/editOutMinRecordInfo",
type: "POST",
data: JSON.stringify(req),
dataType: 'json',
contentType: "application/json;charset=utf-8",
success: function (res) {
if (res.status === 205) {
layer.msg("修改成功", {
icon: 1,
time: 1000
}, function () {
var index = parent.layer.getFrameIndex(window.name);
parent.location.reload(); //刷新父页面
parent.layer.close(index);
})
} else {
layer.msg(res.statusInfo.detail, {
icon: 5,
time: 1000
}, function () {
flagForForm = false;
})
}
}
})
}
}
}
})
</script>
</body>
</html>

18
target/classes/templates/pages/company/company-out.html

@ -57,6 +57,7 @@
<script type="text/html" id="currentTableBar">
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-subclass" lay-event="subclass">子类别</a>
<a class="layui-btn layui-btn-xs data-count-edit" lay-event="detail">详情</a>
<a class="layui-btn layui-btn-xs data-count-edit" lay-event="post">岗位</a>
</script>
</div>
@ -166,7 +167,7 @@
layer.full(index);
});
return false;
} else if (obj.event == 'subclass') {
} else if (obj.event === 'subclass') {
var index = layer.open({
title: '子公司',
type: 2,
@ -181,6 +182,21 @@
});
return false;
}
else if (obj.event === 'post') {
var index = layer.open({
title: '岗位列表',
type: 2,
shade: 0.2,
maxmin: true,
shadeClose: true,
area: ['100%', '100%'],
content: '/findPostByOrganization?organization=' + data.id
});
$(window).on("resize", function () {
layer.full(index);
});
return false;
}
})
});
</script>

19
target/classes/templates/pages/post/post-out.html

@ -56,8 +56,8 @@
<script type="text/html" id="currentTableBar">
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-subclass" lay-event="subclass">子类别</a>
<a class="layui-btn layui-btn-xs data-count-edit" lay-event="detail">详情</a>
<a class="layui-btn layui-btn-xs data-count-edit" lay-event="add_role">设置权限</a>
<a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="addRoleIn">入库审核权</a>
<!-- <a class="layui-btn layui-btn-xs data-count-edit" lay-event="add_role">设置权限</a>-->
<!-- <a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="addRoleIn">入库审核权</a>-->
</script>
</div>
@ -114,7 +114,19 @@
limit: 10,
page: true,
skin: 'line',
done: function () {
done: function (res, curr, count) {
$.each(res['data'], function (i, j) {
let administrativeorganization = j["administrativeorganization"];
var controlItem = $("[lay-id='currentTableId'] tr:eq(" + (i + 1) + ")").children()[8];
var aItem = controlItem.childNodes[0];
if(administrativeorganization === 361){
$(aItem).append('<a class="layui-btn layui-btn-xs layui-btn-danger " lay-event="addRoleIn">设置权限</a>')
}else{
$(aItem).append('<a class="layui-btn layui-btn-xs layui-btn-danger " lay-event="add_role">设置权限</a>')
}
})
}
});
@ -194,7 +206,6 @@
});
return false;
}else if (obj.event === 'addRoleIn') {
var index = layer.open({
type: 2,
title: '权限信息',

Loading…
Cancel
Save