Browse Source

为出入库查询添加申请人的部门名称

lwx_dev
erdanergou 3 years ago
parent
commit
5e20aac531
  1. 31
      src/main/java/com/dreamchaser/depository_manage/controller/PageController.java
  2. 5
      src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationInRecordP.java
  3. 4
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  4. 1
      src/main/resources/templates/pages/depository/table-in.html
  5. 4
      src/main/resources/templates/pages/depository/table-in_mobile.html
  6. 1
      src/main/resources/templates/pages/depository/table-out.html
  7. 4
      src/main/resources/templates/pages/depository/table-out_mobile.html

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

@ -1959,11 +1959,11 @@ public class PageController {
Inventory inventoryById = materialService.findInventoryById(applicationOutRecordMin.getMid()); Inventory inventoryById = materialService.findInventoryById(applicationOutRecordMin.getMid());
// 获取出库物料仓库信息 // 获取出库物料仓库信息
Integer depositoryId = applicationOutRecordMin.getDepositoryId(); Integer depositoryId = applicationOutRecordMin.getDepositoryId();
if(!depositoryIdList.contains(depositoryId)){ if (!depositoryIdList.contains(depositoryId)) {
depositoryIdList.add(depositoryId); depositoryIdList.add(depositoryId);
} }
Integer placeId = applicationOutRecordMin.getPlaceId(); Integer placeId = applicationOutRecordMin.getPlaceId();
if(!placeIdList.contains(placeId)){ if (!placeIdList.contains(placeId)) {
placeIdList.add(placeId); placeIdList.add(placeId);
} }
applicationOutRecordMin.setMname(inventoryById.getMname()); applicationOutRecordMin.setMname(inventoryById.getMname());
@ -1973,7 +1973,7 @@ public class PageController {
if ("-1".equals(unit)) { if ("-1".equals(unit)) {
if (inventoryById.getPrice() != null) { if (inventoryById.getPrice() != null) {
double amounts = ObjectFormatUtil.multiply(inventoryById.getPrice(), applicationOutRecordMin.getQuantity()); double amounts = ObjectFormatUtil.multiply(inventoryById.getPrice(), applicationOutRecordMin.getQuantity());
sumPrice = ObjectFormatUtil.sum(sumPrice,amounts); sumPrice = ObjectFormatUtil.sum(sumPrice, amounts);
} }
sumUnit.append(inventoryById.getUnit()).append(","); sumUnit.append(inventoryById.getUnit()).append(",");
@ -1990,7 +1990,7 @@ public class PageController {
if (inventoryById.getPrice() != null) { if (inventoryById.getPrice() != null) {
BigDecimal bd = BigDecimal.valueOf((inventoryById.getPrice() / scale * applicationOutRecordMin.getQuantity())); BigDecimal bd = BigDecimal.valueOf((inventoryById.getPrice() / scale * applicationOutRecordMin.getQuantity()));
double v = bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); double v = bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
sumPrice = ObjectFormatUtil.sum(sumPrice,v); sumPrice = ObjectFormatUtil.sum(sumPrice, v);
} }
} }
} }
@ -2026,7 +2026,7 @@ public class PageController {
depositoryManagerNames.append(user.getName()).append(","); depositoryManagerNames.append(user.getName()).append(",");
} }
List<Depository> depositoryByIds = depositoryService.findDepositoryByIds(depositoryIdList); List<Depository> depositoryByIds = depositoryService.findDepositoryByIds(depositoryIdList);
for (Depository depository:depositoryByIds for (Depository depository : depositoryByIds
) { ) {
depositoryName.append(depository.getDname()).append(","); depositoryName.append(depository.getDname()).append(",");
} }
@ -2110,12 +2110,11 @@ public class PageController {
} }
applicationInRecordPById.setAirapproverName(airapproverName.toString()); applicationInRecordPById.setAirapproverName(airapproverName.toString());
} }
mv.addObject("record", applicationInRecordPById);
mv.addObject("placeCode", placeCode);
if (Integer.compare(flagForGroup, 2) != 0) { if (Integer.compare(flagForGroup, 2) != 0) {
// 如果不是组合 // 如果不是组合
UserByPort userByPort = LinkInterfaceUtil.FindUserById(applicationInRecordPById.getApplicantId(), userKey, token); UserByPort userByPort = LinkInterfaceUtil.FindUserById(applicationInRecordPById.getApplicantId(), userKey, token);
applicationInRecordPById.setApplicantName(userByPort.getName()); applicationInRecordPById.setApplicantName(userByPort.getMaindeparmentname() + "_" + userByPort.getName());
applicationInRecordPById.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationInRecordPById.getApplicantTime()))); applicationInRecordPById.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationInRecordPById.getApplicantTime())));
if (applicationInRecordPById.getPrice() != null) { if (applicationInRecordPById.getPrice() != null) {
applicationInRecordPById.setPrice(applicationInRecordPById.getPrice() / 100); applicationInRecordPById.setPrice(applicationInRecordPById.getPrice() / 100);
@ -2134,6 +2133,8 @@ public class PageController {
mv.addObject("groupInfoList", groupInfoList); mv.addObject("groupInfoList", groupInfoList);
mv.setViewName("pages/application/form-step-look_group"); mv.setViewName("pages/application/form-step-look_group");
} }
mv.addObject("record", applicationInRecordPById);
mv.addObject("placeCode", placeCode);
} else { } else {
throw new MyException("缺少必要参数!"); throw new MyException("缺少必要参数!");
} }
@ -2411,7 +2412,7 @@ public class PageController {
if (inventoryById.getPrice() != null) { if (inventoryById.getPrice() != null) {
BigDecimal bd = BigDecimal.valueOf(inventoryById.getPrice() * recordMinP.getQuantity()); BigDecimal bd = BigDecimal.valueOf(inventoryById.getPrice() * recordMinP.getQuantity());
double v = bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); double v = bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
sumPrice = ObjectFormatUtil.sum(sumPrice,v); sumPrice = ObjectFormatUtil.sum(sumPrice, v);
} }
} else { } else {
@ -2428,7 +2429,7 @@ public class PageController {
if (inventoryById.getPrice() != null) { if (inventoryById.getPrice() != null) {
BigDecimal bd = BigDecimal.valueOf((inventoryById.getPrice() / scale * recordMinP.getQuantity())); BigDecimal bd = BigDecimal.valueOf((inventoryById.getPrice() / scale * recordMinP.getQuantity()));
double v = bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); double v = bd.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
sumPrice = ObjectFormatUtil.sum(sumPrice,v); sumPrice = ObjectFormatUtil.sum(sumPrice, v);
} }
} }
recordMinPList.add(recordMinP); recordMinPList.add(recordMinP);
@ -2451,9 +2452,9 @@ public class PageController {
List<Place> placeByIdS = placeService.findPlaceByIdS(placeIdList); List<Place> placeByIdS = placeService.findPlaceByIdS(placeIdList);
for (Place place : placeByIdS) { for (Place place : placeByIdS) {
int placeId = place.getId(); int placeId = place.getId();
if(placeId == 0){ if (placeId == 0) {
placeCode.append("默认库位").append(","); placeCode.append("默认库位").append(",");
}else{ } else {
placeCode.append(place.getKingdeecode()).append(","); placeCode.append(place.getKingdeecode()).append(",");
} }
} }
@ -2517,7 +2518,7 @@ public class PageController {
mv.addObject("display", "none"); mv.addObject("display", "none");
} }
applicationOutRecordPById.setApplicantName(userByPort.getName()); applicationOutRecordPById.setApplicantName(userByPort.getMaindeparmentname() + "_" + userByPort.getName());
applicationOutRecordPById.setDepartmentheadName(departmentHeadName.toString()); applicationOutRecordPById.setDepartmentheadName(departmentHeadName.toString());
applicationOutRecordPById.setDepositoryManagerName(depositoryManagerNames.toString()); applicationOutRecordPById.setDepositoryManagerName(depositoryManagerNames.toString());
applicationOutRecordPById.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationOutRecordPById.getApplicantTime()))); applicationOutRecordPById.setApplicantTime(DateUtil.TimeStampToDateTime(Long.valueOf(applicationOutRecordPById.getApplicantTime())));
@ -3108,8 +3109,8 @@ public class PageController {
public ModelAndView ScanBarOrQrCodeOut_selectMaterial(Integer pid, String mcode, Integer depositoryId) { public ModelAndView ScanBarOrQrCodeOut_selectMaterial(Integer pid, String mcode, Integer depositoryId) {
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("depositoryId",depositoryId); map.put("depositoryId", depositoryId);
map.put("pid",pid); map.put("pid", pid);
List<Integer> midList = materialService.findInventoryForCompleteOutTask(map); List<Integer> midList = materialService.findInventoryForCompleteOutTask(map);
if (midList.size() > 0) { if (midList.size() > 0) {
List<Inventory> materialByIds = materialService.findMaterialByIds(midList); List<Inventory> materialByIds = materialService.findMaterialByIds(midList);

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

@ -31,6 +31,11 @@ public class ApplicationInRecordP {
*/ */
private String applicantName; private String applicantName;
/**
* 部门名称
*/
private String adminorgName;
/** /**
* 提交人id * 提交人id
*/ */

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

@ -4237,6 +4237,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
applicationInRecord.setMversion("组合"); applicationInRecord.setMversion("组合");
} }
ApplicationInRecordP ap = new ApplicationInRecordP(applicationInRecord); ApplicationInRecordP ap = new ApplicationInRecordP(applicationInRecord);
ap.setAdminorgName(userByPortById.getMaindeparmentname());
result.add(ap); result.add(ap);
} }
return result; return result;
@ -4291,6 +4292,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
applicationInRecord.setMversion("组合"); applicationInRecord.setMversion("组合");
} }
ApplicationInRecordP arp = new ApplicationInRecordP(applicationInRecord); ApplicationInRecordP arp = new ApplicationInRecordP(applicationInRecord);
arp.setAdminorgName(userByPortById.getMaindeparmentname());
result.add(arp); result.add(arp);
} }
@ -4351,6 +4353,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
record.setApplicantTime(time); record.setApplicantTime(time);
record.setApplyRemark(record.getApplyRemark() == null ? "" : record.getApplyRemark()); record.setApplyRemark(record.getApplyRemark() == null ? "" : record.getApplyRemark());
ApplicationOutRecordP recordP = new ApplicationOutRecordP(record); ApplicationOutRecordP recordP = new ApplicationOutRecordP(record);
recordP.setAdminorgName(userByPortById.getMaindeparmentname());
result.add(recordP); result.add(recordP);
} }
return result; return result;
@ -4422,6 +4425,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
recordP.setApplicantTime(time); recordP.setApplicantTime(time);
recordP.setApplyRemark(recordP.getApplyRemark() == null ? "" : recordP.getApplyRemark()); recordP.setApplyRemark(recordP.getApplyRemark() == null ? "" : recordP.getApplyRemark());
ApplicationOutRecordP aorp = new ApplicationOutRecordP(recordP); ApplicationOutRecordP aorp = new ApplicationOutRecordP(recordP);
aorp.setAdminorgName(userByPortById.getMaindeparmentname());
result.add(aorp); result.add(aorp);
} }
return result; return result;

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

@ -176,6 +176,7 @@
{field: 'quantity', width: 150, title: '数量', sort: true}, {field: 'quantity', width: 150, title: '数量', sort: true},
{field: 'depositoryName', width: 150, title: '仓库名称'}, {field: 'depositoryName', width: 150, title: '仓库名称'},
{field: 'applicantName', width: 200, title: '提交人'}, {field: 'applicantName', width: 200, title: '提交人'},
{field: 'adminorgName', width: 150, title: '提交人部门'},
{field: 'applicantTime', width: 200, title: '提交时间', sort: true}, {field: 'applicantTime', width: 200, title: '提交时间', sort: true},
{field: 'applyRemark', width: 200, title: '备注'}, {field: 'applyRemark', width: 200, title: '备注'},
{field: 'airstate', width: 200, title: '状态'}, {field: 'airstate', width: 200, title: '状态'},

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

@ -133,7 +133,7 @@
brandItem = ""; brandItem = "";
} }
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail(' lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail('
+ result[i].id + ')"><div class="layui-card-header"><h3 style="font-weight: bold">' + result[i].applicantName + "的入库申请" + '</h3></div>'); + result[i].id + ')"><div class="layui-card-header"><h3 style="font-weight: bold">' + result[i].adminorgName+"_"+result[i].applicantName + "的入库申请" + '</h3></div>');
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #666;font-size: 15px;">' lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #666;font-size: 15px;">'
+ '<p >' + "物料名称:"+ result[i].mname + '</p>' + '<p >' + "物料名称:"+ result[i].mname + '</p>'
+ '<p>' + "物料型号:"+result[i].mversion + '</p>' + '<p>' + "物料型号:"+result[i].mversion + '</p>'
@ -240,7 +240,7 @@
brandItem = ""; brandItem = "";
} }
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail(' lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail('
+ result[i].id + ')"><div class="layui-card-header"><h3 style="font-weight: bold">' + result[i].applicantName + "的入库申请" + '</h3></div>'); + result[i].id + ')"><div class="layui-card-header"><h3 style="font-weight: bold">' + result[i].adminorgName+"_"+result[i].applicantName + "的入库申请" + '</h3></div>');
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #666;font-size: 15px;">' lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #666;font-size: 15px;">'
+ '<p >' + "物料名称:"+ result[i].mname + '</p>' + '<p >' + "物料名称:"+ result[i].mname + '</p>'
+ '<p>' + "物料型号:"+result[i].mversion + '</p>' + '<p>' + "物料型号:"+result[i].mversion + '</p>'

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

@ -188,6 +188,7 @@
} }
}, },
{field: 'applicantName', width: 150, title: '申请人'}, {field: 'applicantName', width: 150, title: '申请人'},
{field: 'adminorgName', width: 150, title: '申请人部门'},
{field: 'applicantTime', width: 200, title: '申请时间', sort: true}, {field: 'applicantTime', width: 200, title: '申请时间', sort: true},
{ {
field: 'istransfer', title: '是否为转移申请', minWidth: 120, templet: function (d) { field: 'istransfer', title: '是否为转移申请', minWidth: 120, templet: function (d) {

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

@ -135,7 +135,7 @@
}); });
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail(' lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail('
+ result[i].id + ')"><div class="layui-card-header"><h3 style="font-weight: bold">' + result[i].applicantName + "的出库申请" + '</h3></div>'); + result[i].id + ')"><div class="layui-card-header"><h3 style="font-weight: bold">' +result[i].adminorgName+"_"+ result[i].applicantName + "的出库申请" + '</h3></div>');
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #666;font-size: 15px;">' lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #666;font-size: 15px;">'
+ mnameItem + mnameItem
+ '<p>' + "申请总数:" + result[i].quantity + '</p>' + '<p>' + "申请总数:" + result[i].quantity + '</p>'
@ -266,7 +266,7 @@
for (let i = 0; i < result.length; i++) { for (let i = 0; i < result.length; i++) {
lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail(' lis.push('<li style="width:100%;margin-top: 10px;float:left;border: 1px solid #9999996e;"><div class="layui-card my-shadow my-card flow1" onclick="showDetail('
+ result[i].id + ')"><div class="layui-card-header"><h3 style="font-weight: bold;"> ' + result[i].applicantName + "的出库申请" + '</h3></div>'); + result[i].id + ')"><div class="layui-card-header"><h3 style="font-weight: bold;"> ' +result[i].adminorgName+"_"+ result[i].applicantName + "的出库申请" + '</h3></div>');
lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #666;font-size: 15px;">' lis.push('<div class="layui-col-md4 my-info" style="margin-left: 15px; color: #666;font-size: 15px;">'
+ '<p style="font-size: large">' + result[i].mname + '</p>' + '<p style="font-size: large">' + result[i].mname + '</p>'
+ '<p>' + result[i].mversion + '</p>' + '<p>' + result[i].mversion + '</p>'

Loading…
Cancel
Save