Browse Source

将入库相关处理抽离

lwx_dev
erdanergou 3 years ago
parent
commit
49b6af1257
  1. 4
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  2. 198
      src/main/resources/templates/pages/application/application-in.html
  3. 39
      src/main/resources/templates/pages/application/application-in_back.html
  4. 111
      src/main/resources/templates/pages/application/application-in_scanQrCode.html
  5. 186
      src/main/resources/templates/pages/application/application-out.html
  6. 53
      src/main/resources/templates/pages/application/application-out_back.html
  7. 71
      src/main/resources/templates/pages/application/application-out_scanQrCode.html
  8. 125
      src/main/resources/templates/pages/application/application-transfer.html
  9. 69
      src/main/resources/templates/pages/application/application-transfer_back.html
  10. 6
      src/test/java/com/dreamchaser/depository_manage/TestOther.java

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

@ -107,7 +107,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
@Transactional(rollbackFor = Exception.class)
public Integer applicationIn(Map<String, Object> map) {
Boolean flagForApproval = ObjectFormatUtil.toBoolean(map.get("flagForApproval"));
Integer depositoryId = ObjectFormatUtil.toInteger(map.get("depositoryId"));
Depository depositoryRecordById = depositoryMapper.findDepositoryById(depositoryId);
Map<String, Object> temp = new HashMap<>();
@ -666,6 +665,9 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
Integer result = updateInventoryInfoForApproval(map, quantity, materialById, placeById);
map.remove("applicationInId");
return result;
}else{
map.put("applicationInId",map.get("id"));
map.remove("id");
}
return integer;
} else {

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

@ -699,73 +699,76 @@
var req = {};
req.code = code;
req.type = "in";
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data: req,
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
var idNumber = materialId.name.split("mid")[1];
if (d == null) {
layer.msg("没有该编码,请确认是否输入正确");
materialName.value = "";
materialId.value = "";
obj.value = "";
$("#barCode" + idNumber).empty();
$("#unit" + idNumber).empty();
form.render();
if(code !== ""){
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data: req,
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
var idNumber = materialId.name.split("mid")[1];
if (d == null) {
layer.msg("没有该编码,请确认是否输入正确");
materialName.value = "";
materialId.value = "";
obj.value = "";
$("#barCode" + idNumber).empty();
$("#unit" + idNumber).empty();
form.render();
} else {
materialName.value = d.mname;
materialId.value = d.mid;
// 获取物料与条形码的对应关系
var materialAndBarCodeList = d["materialAndBarCodeList"];
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
}
var unit = $("#unit" + idNumber);
unit.empty();
$("#unit" + idNumber).append(new Option(d.baseUnit, "-1"));
var unitList = d["splitInfoList"];
for (let i = 0; i < unitList.length; i++) {
$("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
}
form.render();
if (materialAndBarCodeList.length > 0) {
// 如果有对应的条形码
var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
var id = barCodeInput.id;
$("#" + id).remove();
} else {
materialName.value = d.mname;
materialId.value = d.mid;
// 获取物料与条形码的对应关系
var materialAndBarCodeList = d["materialAndBarCodeList"];
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
} else {
var barCodeSelect = `
<select id=` + "barCode" + idNumber + ` name=` + "barCode" + idNumber + `>
</select>`;
$("#" + barCodeImg.id).before(barCodeSelect);
}
var unit = $("#unit" + idNumber);
unit.empty();
$("#unit" + idNumber).append(new Option(d.baseUnit, "-1"));
var unitList = d["splitInfoList"];
for (let i = 0; i < unitList.length; i++) {
$("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
}
form.render();
if (materialAndBarCodeList.length > 0) {
// 如果有对应的条形码
var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
var id = barCodeInput.id;
$("#" + id).remove();
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
} else {
var barCodeSelect = `
<select id=` + "barCode" + idNumber + ` name=` + "barCode" + idNumber + `>
</select>`;
$("#" + barCodeImg.id).before(barCodeSelect);
}
form.render();
$.each(materialAndBarCodeList, function (index, item) {
$("#barCode" + idNumber).append(new Option(item.bmcode, item.bmcode));//往下拉菜单里添加元素
});
form.render();
}
var shelfLife = d.shelfLife;
if (shelfLife !== null && shelfLife !== undefined) {
$("#" + "producedDateItem" + idNumber).show();
$("#" + "producedDate" + idNumber).attr("lay-verify", "required");
} else {
$("#" + "producedDateItem" + idNumber).hide();
$.each(materialAndBarCodeList, function (index, item) {
$("#barCode" + idNumber).append(new Option(item.bmcode, item.bmcode));//往下拉菜单里添加元素
});
form.render();
}
var shelfLife = d.shelfLife;
if (shelfLife !== null && shelfLife !== undefined) {
$("#" + "producedDateItem" + idNumber).show();
$("#" + "producedDate" + idNumber).attr("lay-verify", "required");
} else {
$("#" + "producedDateItem" + idNumber).hide();
}
}
}
}
});
});
}
};
// 用于实现点击搜索按钮
@ -1255,50 +1258,53 @@
// gname
let gnameItem = gnameParent.childNodes[1].childNodes[1];
let req = {};
req.code = code;
$.ajax({
url: "/group/findGroupByCodeForIn",
type: "post",
dataType: 'json',
data: JSON.stringify(req),
contentType: "application/json;charset=utf-8",
success: function (d) {
var data = d.data;
if (data === null) {
layer.msg(d.statusInfo.detail, {
icon: 0,
time: 1500
}, function () {
obj.value = '';
gidItem.value = '';
gnameItem.value = '';
if(code !== ""){
req.code = code;
$.ajax({
url: "/group/findGroupByCodeForIn",
type: "post",
dataType: 'json',
data: JSON.stringify(req),
contentType: "application/json;charset=utf-8",
success: function (d) {
var data = d.data;
if (data === null) {
layer.msg(d.statusInfo.detail, {
icon: 0,
time: 1500
}, function () {
obj.value = '';
gidItem.value = '';
gnameItem.value = '';
let childNodes = parent.childNodes;
for (let i = 0; i < childNodes.length; i++) {
if (childNodes[i].className === "layui-collapse") {
childNodes[i].remove()
}
}
})
} else {
let childNodes = parent.childNodes;
for (let i = 0; i < childNodes.length; i++) {
if (childNodes[i].className === "layui-collapse") {
childNodes[i].remove()
if (childNodes.length > 9) {
for (let i = 0; i < childNodes.length; i++) {
if (childNodes[i].className === "layui-collapse") {
childNodes[i].remove()
}
}
}
})
} else {
let childNodes = parent.childNodes;
if (childNodes.length > 9) {
for (let i = 0; i < childNodes.length; i++) {
if (childNodes[i].className === "layui-collapse") {
childNodes[i].remove()
}
// 赋值给gname
gnameItem.value = data[0].gname;
gidItem.value = data[0].gid;
for (let i = 0; i < data.length; i++) {
CoverpageForGroup(pid, data[i]);
}
}
// 赋值给gname
gnameItem.value = data[0].gname;
gidItem.value = data[0].gid;
for (let i = 0; i < data.length; i++) {
CoverpageForGroup(pid, data[i]);
}
element.init();
element.init();
}
}
}
});
});
}
};
// 用于实现点击搜索按钮(组合)

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

@ -158,25 +158,28 @@
var req = {};
req.code = code;
req.type = "in";
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data:(req),
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
if(d == null){
layer.msg("没有该编码,请确认是否输入正确");
$("#openSonByMaterial").val("");
$("#mid").val("");
$("#code").val("");
}else{
$("#openSonByMaterial").val(d.mname);
$("#mid").val(d.id);
if(code !== ""){
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data:(req),
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
if(d == null){
layer.msg("没有该编码,请确认是否输入正确");
$("#openSonByMaterial").val("");
$("#mid").val("");
$("#code").val("");
}else{
$("#openSonByMaterial").val(d.mname);
$("#mid").val(d.id);
}
}
}
});
});
}
});
$("#openSonByMaterial").blur(function () {

111
src/main/resources/templates/pages/application/application-in_scanQrCode.html

@ -611,66 +611,69 @@
var req = {};
req.code = code;
req.type = "in";
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data: req,
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
var idNumber = materialId.name.split("mid")[1];
if (d == null) {
layer.msg("没有该编码,请确认是否输入正确");
materialName.value = "";
materialId.value = "";
obj.value = "";
$("#barCode" + idNumber).remove();
form.render();
} else {
materialName.value = d.mname;
materialId.value = d.id;
// 获取物料与条形码的对应关系
var materialAndBarCodeList = d["materialAndBarCodeList"];
var splitInfoList = d["splitInfoList"];
let unit = $("#unit" + idNumber);
unit.empty();
unit.append(new Option(d.unit, "-1"));
$.each(splitInfoList, function (index, item) {
unit.append(new Option(item.newUnit, item.newUnit));//往下拉菜单里添加元素
});
form.render();
if (materialAndBarCodeList.length > 0) {
// 如果有对应的条形码
var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
var id = barCodeInput.id;
$("#" + id).remove();
$("#barCode" + idNumber).empty();
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
} else {
var barCodeSelect = `
<select id=` + "barCode" + idNumber + ` name=` + "barCode" + idNumber + `>
</select>`;
$("#" + barCodeImg.id).before(barCodeSelect);
}
if(code !== ""){
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data: req,
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
var idNumber = materialId.name.split("mid")[1];
if (d == null) {
layer.msg("没有该编码,请确认是否输入正确");
materialName.value = "";
materialId.value = "";
obj.value = "";
$("#barCode" + idNumber).remove();
form.render();
$.each(materialAndBarCodeList, function (index, item) {
$("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
} else {
materialName.value = d.mname;
materialId.value = d.id;
// 获取物料与条形码的对应关系
var materialAndBarCodeList = d["materialAndBarCodeList"];
var splitInfoList = d["splitInfoList"];
let unit = $("#unit" + idNumber);
unit.empty();
unit.append(new Option(d.unit, "-1"));
$.each(splitInfoList, function (index, item) {
unit.append(new Option(item.newUnit, item.newUnit));//往下拉菜单里添加元素
});
form.render();
} else {
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
if (materialAndBarCodeList.length > 0) {
// 如果有对应的条形码
var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
var id = barCodeInput.id;
$("#" + id).remove();
$("#barCode" + idNumber).empty();
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
} else {
var barCodeSelect = `
<select id=` + "barCode" + idNumber + ` name=` + "barCode" + idNumber + `>
</select>`;
$("#" + barCodeImg.id).before(barCodeSelect);
}
form.render();
$.each(materialAndBarCodeList, function (index, item) {
$("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
});
form.render();
} else {
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
}
}
}
}
}
});
});
}
};
// 用于实现点击搜索按钮

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

@ -762,65 +762,68 @@
var req = {};
req.code = code;
req.type = "out";
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data: (req),
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
if (d == null) {
layer.msg("仓库中暂无该物料");
materialName.value = "";
materialId.value = "";
obj.value = "";
$('#place' + objId).empty();
if(code !== ""){
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data: (req),
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
if (d == null) {
layer.msg("仓库中暂无该物料");
materialName.value = "";
materialId.value = "";
obj.value = "";
$('#place' + objId).empty();
} else {
materialName.value = d.mname;
materialId.value = d.id;
var idNumber = materialId.name.split("mid")[1];
// 获取物料与条形码的对应关系
var materialAndBarCodeList = d["materialAndBarCodeList"];
var unit = $("#unit" + idNumber);
unit.empty();
$("#unit" + idNumber).append(new Option(d.baseUnit, "-1"));
var unitList = d["splitInfoList"];
for (let i = 0; i < unitList.length; i++) {
$("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
}
form.render();
if (materialAndBarCodeList.length > 0) {
// 如果有对应的条形码
var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
var id = barCodeInput.id;
$("#" + id).remove();
$("#barCode" + idNumber).empty();
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
} else {
var barCodeSelect = `
<select id=` + "barCode" + idNumber + ` name=` + "barCode" + idNumber + `>
</select>`;
$("#" + barCodeImg.id).before(barCodeSelect);
} else {
materialName.value = d.mname;
materialId.value = d.id;
var idNumber = materialId.name.split("mid")[1];
// 获取物料与条形码的对应关系
var materialAndBarCodeList = d["materialAndBarCodeList"];
var unit = $("#unit" + idNumber);
unit.empty();
$("#unit" + idNumber).append(new Option(d.baseUnit, "-1"));
var unitList = d["splitInfoList"];
for (let i = 0; i < unitList.length; i++) {
$("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
}
form.render();
$.each(materialAndBarCodeList, function (index, item) {
$("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
});
form.render();
} else {
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
if (materialAndBarCodeList.length > 0) {
// 如果有对应的条形码
var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
var id = barCodeInput.id;
$("#" + id).remove();
$("#barCode" + idNumber).empty();
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
} else {
var barCodeSelect = `
<select id=` + "barCode" + idNumber + ` name=` + "barCode" + idNumber + `>
</select>`;
$("#" + barCodeImg.id).before(barCodeSelect);
}
form.render();
$.each(materialAndBarCodeList, function (index, item) {
$("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
});
form.render();
} else {
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
}
}
}
}
}
});
});
}
};
// 用于实现通过编码查询组合
@ -840,49 +843,52 @@
let gnameItem = gnameParent.childNodes[1].childNodes[1];
let req = {};
req.code = code;
$.ajax({
url: "/group/findGroupByCode",
type: "post",
dataType: 'json',
data: JSON.stringify(req),
contentType: "application/json;charset=utf-8",
success: function (d) {
var data = d.data;
if (data === null) {
layer.msg(d.statusInfo.detail, {
icon: 0,
time: 1500
},function () {
obj.value = '';
gidItem.value = '';
gnameItem.value = '';
if(code !== ""){
$.ajax({
url: "/group/findGroupByCode",
type: "post",
dataType: 'json',
data: JSON.stringify(req),
contentType: "application/json;charset=utf-8",
success: function (d) {
var data = d.data;
if (data === null) {
layer.msg(d.statusInfo.detail, {
icon: 0,
time: 1500
},function () {
obj.value = '';
gidItem.value = '';
gnameItem.value = '';
let childNodes = parent.childNodes;
for (let i = 0; i < childNodes.length; i++) {
if (childNodes[i].className === "layui-collapse") {
childNodes[i].remove()
}
}
})
} else {
let childNodes = parent.childNodes;
for (let i = 0; i < childNodes.length; i++) {
if (childNodes[i].className === "layui-collapse") {
childNodes[i].remove()
if (childNodes.length > 9) {
for (let i = 0; i < childNodes.length; i++) {
if (childNodes[i].className === "layui-collapse") {
childNodes[i].remove()
}
}
}
})
} else {
let childNodes = parent.childNodes;
if (childNodes.length > 9) {
for (let i = 0; i < childNodes.length; i++) {
if (childNodes[i].className === "layui-collapse") {
childNodes[i].remove()
}
// 赋值给gname
gnameItem.value = data[0].gname;
gidItem.value = data[0].gid;
for (let i = 0; i < data.length; i++) {
CoverpageForGroup(pid, data[i]);
}
}
// 赋值给gname
gnameItem.value = data[0].gname;
gidItem.value = data[0].gid;
for (let i = 0; i < data.length; i++) {
CoverpageForGroup(pid, data[i]);
}
element.init();
element.init();
}
}
}
});
});
}
};
// 用于实现点击搜索按钮

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

@ -156,32 +156,35 @@
var req = {};
req.code = code;
req.type = "out";
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data: (req),
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
if (d == null) {
layer.msg("没有该编码,请确认是否输入正确");
$("#mname").val("");
$("#mid").val("");
} else {
req.mid = d.id;
let unitItem = $("#unit");
unitItem.empty();
unitItem.append(new Option(d.baseUnit, "-1"));
$.each(d.splitInfoList, function (index, item) {
$("#unit").append(new Option(item.newUnit, item.newUnit));
});
$("#mname").val(d.mname);
$("#mid").val(d.id);
form.render();
if(code !== ""){
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data: (req),
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
if (d == null) {
layer.msg("没有该编码,请确认是否输入正确");
$("#mname").val("");
$("#mid").val("");
} else {
req.mid = d.id;
let unitItem = $("#unit");
unitItem.empty();
unitItem.append(new Option(d.baseUnit, "-1"));
$.each(d.splitInfoList, function (index, item) {
$("#unit").append(new Option(item.newUnit, item.newUnit));
});
$("#mname").val(d.mname);
$("#mid").val(d.id);
form.render();
}
}
}
})
})
}
});
$("#mname").blur(function () {

71
src/main/resources/templates/pages/application/application-out_scanQrCode.html

@ -448,42 +448,45 @@
var req = {};
req.code = code;
req.type = "out";
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data:(req),
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
if(d == null){
layer.msg("没有该编码,请确认是否输入正确");
materialName.value = "";
materialId.value = "";
obj.value = "";
$('#place').empty();
}else{
req.mid = d.id;
$.ajax({
url: "/place/findPlaceByMid",
type: "post",
dataType: 'json',
data:JSON.stringify(req),
contentType: "application/json;charset=utf-8",
success:function (res) {
$('#place').empty();
$.each(res.data, function (index, item) {
$('#place').append(new Option(item.depositoryName+"-"+item.code, item.id));//往下拉菜单里添加元素
});
form.render();
materialName.value = d.mname;
materialId.value = d.id;
}
});
if(code !== ""){
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data:(req),
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
if(d == null){
layer.msg("没有该编码,请确认是否输入正确");
materialName.value = "";
materialId.value = "";
obj.value = "";
$('#place').empty();
}else{
req.mid = d.id;
$.ajax({
url: "/place/findPlaceByMid",
type: "post",
dataType: 'json',
data:JSON.stringify(req),
contentType: "application/json;charset=utf-8",
success:function (res) {
$('#place').empty();
$.each(res.data, function (index, item) {
$('#place').append(new Option(item.depositoryName+"-"+item.code, item.id));//往下拉菜单里添加元素
});
form.render();
materialName.value = d.mname;
materialId.value = d.id;
}
});
}
}
}
});
});
}
};
// 用于实现点击搜索按钮

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

@ -610,78 +610,81 @@
var req = {};
req.code = code;
req.type = "out";
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data:req,
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
if(d == null){
layer.msg("没有该编码,请确认是否输入正确");
materialName.value = "";
materialId.value = "";
obj.value = "";
}else{
req.mid = d.id;
$.ajax({
url: "/place/findPlaceByMid",
type: "post",
dataType: 'json',
data:JSON.stringify(req),
contentType: "application/json;charset=utf-8",
success:function (res) {
var idNumber = materialId.name.split("mid")[1];
// 获取物料与条形码的对应关系
var materialAndBarCodeList = d["materialAndBarCodeList"];
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
}
var unit = $("#unit" + idNumber);
unit.empty();
$("#unit" + idNumber).append(new Option(d.baseUnit, "-1"));
var unitList = d["splitInfoList"];
for (let i = 0; i < unitList.length; i++) {
$("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
}
form.render();
if (materialAndBarCodeList.length > 0) {
// 如果有对应的条形码
var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
var id = barCodeInput.id;
$("#" + id).remove();
if(code !== ""){
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data:req,
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
if(d == null){
layer.msg("没有该编码,请确认是否输入正确");
materialName.value = "";
materialId.value = "";
obj.value = "";
}else{
req.mid = d.id;
$.ajax({
url: "/place/findPlaceByMid",
type: "post",
dataType: 'json',
data:JSON.stringify(req),
contentType: "application/json;charset=utf-8",
success:function (res) {
var idNumber = materialId.name.split("mid")[1];
// 获取物料与条形码的对应关系
var materialAndBarCodeList = d["materialAndBarCodeList"];
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
} else {
var barCodeSelect = `
}
var unit = $("#unit" + idNumber);
unit.empty();
$("#unit" + idNumber).append(new Option(d.baseUnit, "-1"));
var unitList = d["splitInfoList"];
for (let i = 0; i < unitList.length; i++) {
$("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit));
}
form.render();
if (materialAndBarCodeList.length > 0) {
// 如果有对应的条形码
var barCodeInput = barCodeItem.childNodes[1].childNodes[1];
var barCodeImg = barCodeItem.childNodes[1].childNodes[3];
var id = barCodeInput.id;
$("#" + id).remove();
var barCode = $("#barCode" + idNumber);
if (barCode.length > 0) {
barCode.empty();
} else {
var barCodeSelect = `
<select id=` + "barCode" + idNumber + ` name=` + "barCode" + idNumber + `>
</select>`;
$("#" + barCodeImg.id).before(barCodeSelect);
$("#" + barCodeImg.id).before(barCodeSelect);
}
form.render();
$.each(materialAndBarCodeList, function (index, item) {
$("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
});
form.render();
}
form.render();
$('#place' + codeId).empty();
$.each(materialAndBarCodeList, function (index, item) {
$("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素
$.each(res.data, function (index, item) {
$('#place' + codeId).append(new Option(item.depositoryName + "-" + item.code, item.id));//往下拉菜单里添加元素
});
form.render();
materialName.value = d.mname;
materialId.value = d.id;
}
$('#place' + codeId).empty();
$.each(res.data, function (index, item) {
$('#place' + codeId).append(new Option(item.depositoryName + "-" + item.code, item.id));//往下拉菜单里添加元素
});
form.render();
materialName.value = d.mname;
materialId.value = d.id;
}
});
});
}
}
}
});
});
}
};
// 用于实现点击搜索按钮

69
src/main/resources/templates/pages/application/application-transfer_back.html

@ -330,40 +330,43 @@
var req = {};
req.code = code;
req.type = "out";
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data:req,
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
if(d == null){
layer.msg("没有该编码,请确认是否输入正确");
materialName.value = "";
materialId.value = "";
obj.value = "";
}else{
req.mid = d.id;
$.ajax({
url: "/place/findPlaceByMid",
type: "post",
dataType: 'json',
data:JSON.stringify(req),
contentType: "application/json;charset=utf-8",
success:function (res) {
$('#place'+id).empty();
$.each(res.data, function (index, item) {
$('#place'+id).append(new Option(item.depositoryName+"-"+item.code, item.id));//往下拉菜单里添加元素
});
form.render();
materialName.value = d.mname;
materialId.value = d.id;
}
});
if(code !== ""){
$.ajax({
url: "/material/findMatrialByCode",
type: "get",
dataType: 'json',
data:req,
contentType: "application/json;charset=utf-8",
success: function (d) {
var d = d.data;
if(d == null){
layer.msg("没有该编码,请确认是否输入正确");
materialName.value = "";
materialId.value = "";
obj.value = "";
}else{
req.mid = d.id;
$.ajax({
url: "/place/findPlaceByMid",
type: "post",
dataType: 'json',
data:JSON.stringify(req),
contentType: "application/json;charset=utf-8",
success:function (res) {
$('#place'+id).empty();
$.each(res.data, function (index, item) {
$('#place'+id).append(new Option(item.depositoryName+"-"+item.code, item.id));//往下拉菜单里添加元素
});
form.render();
materialName.value = d.mname;
materialId.value = d.id;
}
});
}
}
}
});
});
}
};
// 用于实现点击搜索按钮

6
src/test/java/com/dreamchaser/depository_manage/TestOther.java

@ -31,7 +31,11 @@ public class TestOther {
@Test
public void Test() throws IOException {
System.out.println(ObjectFormatUtil.toBoolean("true"));
Map<String,Object> map = new HashMap<>();
Boolean flag = true;
map.put("flag",flag);
Boolean flag1 = ObjectFormatUtil.toBoolean(map.get("flag"));
System.out.println(flag1);
}

Loading…
Cancel
Save