Browse Source

为出库查询添加使用部门(部门负责人字段所在部门)字段

lwx_dev
erdanergou 2 years ago
parent
commit
768a1dea35
  1. 32
      src/main/java/com/dreamchaser/depository_manage/controller/DepositoryRecordController.java
  2. 12
      src/main/java/com/dreamchaser/depository_manage/controller/PageController.java
  3. 7
      src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordP.java
  4. 1
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java
  5. 6
      src/main/resources/templates/pages/application/form-step-look_back.html
  6. 1
      src/main/resources/templates/pages/depository/table-out.html

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

@ -284,8 +284,7 @@ public class DepositoryRecordController {
} }
} }
} }
} } else {
else {
List<Object> errMsg = new ArrayList<>(); List<Object> errMsg = new ArrayList<>();
List<Object> successMsg = new ArrayList<>(); List<Object> successMsg = new ArrayList<>();
for (Integer param : params) { for (Integer param : params) {
@ -1110,11 +1109,30 @@ public class DepositoryRecordController {
) { ) {
depositoryName.append(depository.getDname()).append(","); depositoryName.append(depository.getDname()).append(",");
} }
// 部门负责人
String departmentHead = outRecordP.getDepartmenthead();
String[] split = departmentHead.split(",");
if ("".equals(departmentHead) || departmentHead.isEmpty()) {
// 如果当前没有部门负责人
split = new String[0];
}
String useAdminorgName = "";
for (String value : split) {
if ("".equals(value)) {
continue;
}
UserByPort departmenthead = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(value), userKey, token);
if ("".equals(useAdminorgName)) {
useAdminorgName = departmenthead.getMaindeparmentname();
} else {
break;
}
}
outRecordP.setUseAdminorgName(useAdminorgName);
outRecordP.setDepositoryName(depositoryName.toString()); outRecordP.setDepositoryName(depositoryName.toString());
outRecordP.setQuantity(sumQuantity); outRecordP.setQuantity(sumQuantity);
outRecordP.setPrice(sumPrice); outRecordP.setPrice(sumPrice);
outRecordP.setMnameStringList(mnameForMobiles); outRecordP.setMnameStringList(mnameForMobiles);
} }
return new RestResponse(list, countBy, 200); return new RestResponse(list, countBy, 200);
} }
@ -1685,8 +1703,7 @@ public class DepositoryRecordController {
} }
}); });
} } else if ("out".equals(type)) {
else if ("out".equals(type)) {
// 获取部门负责人 // 获取部门负责人
List<UserByPort> departmentHeadByUsers = PublicConfig.findDepartmentHeadByUser(userToken.getMaindeparment(), userkey, usertoken); List<UserByPort> departmentHeadByUsers = PublicConfig.findDepartmentHeadByUser(userToken.getMaindeparment(), userkey, usertoken);
StringBuilder departmentHeadId = new StringBuilder(); StringBuilder departmentHeadId = new StringBuilder();
@ -1969,8 +1986,7 @@ public class DepositoryRecordController {
} }
}); });
} } else if ("out".equals(type)) {
else if ("out".equals(type)) {
Map<String, Object> mainRecord = new HashMap<>(); Map<String, Object> mainRecord = new HashMap<>();
Integer sumQuantity = 0; Integer sumQuantity = 0;
for (Object o : quantitys) { for (Object o : quantitys) {
@ -1999,7 +2015,7 @@ public class DepositoryRecordController {
mainRecord.put("adminorgId", userToken.getMaindeparment()); mainRecord.put("adminorgId", userToken.getMaindeparment());
mainRecord.put("createUid", userToken.getId()); mainRecord.put("createUid", userToken.getId());
mainRecord.put("flagForAgency", 2); mainRecord.put("flagForAgency", 2);
mainRecord.put("depositoryId",depositoryIds.get(0)); mainRecord.put("depositoryId", depositoryIds.get(0));
// 插入主表 // 插入主表
depositoryRecordService.insertApplicationOutRecord(mainRecord, userToken, userkey, usertoken); depositoryRecordService.insertApplicationOutRecord(mainRecord, userToken, userkey, usertoken);

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

@ -2501,8 +2501,10 @@ public class PageController {
} }
} }
} }
// 申请人 // 申请人Id
UserByPort userByPort = LinkInterfaceUtil.FindUserById(applicationOutRecordPById.getApplicantId(), userKey, token); Integer applicantId = applicationOutRecordPById.getApplicantId();
// 获取申请人信息
UserByPort userByPort = LinkInterfaceUtil.FindUserById(applicantId, userKey, token);
// 部门负责人 // 部门负责人
String departmentHead = applicationOutRecordPById.getDepartmenthead(); String departmentHead = applicationOutRecordPById.getDepartmenthead();
String[] split = departmentHead.split(","); String[] split = departmentHead.split(",");
@ -2511,12 +2513,14 @@ public class PageController {
split = new String[0]; split = new String[0];
} }
StringBuilder departmentHeadName = new StringBuilder(); StringBuilder departmentHeadName = new StringBuilder();
String useAdminorgName = "";
for (String value : split) { for (String value : split) {
if ("".equals(value)) { if ("".equals(value)) {
continue; continue;
} }
UserByPort departmenthead = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(value), userKey, token); UserByPort departmenthead = LinkInterfaceUtil.FindUserById(ObjectFormatUtil.toInteger(value), userKey, token);
departmentHeadName.append(departmenthead.getName()).append(","); departmentHeadName.append(departmenthead.getName()).append(",");
useAdminorgName = departmenthead.getMaindeparmentname();
} }
// 仓储中心负责人 // 仓储中心负责人
String manager = applicationOutRecordPById.getDepositoryManager(); String manager = applicationOutRecordPById.getDepositoryManager();
@ -2536,6 +2540,10 @@ public class PageController {
depositoryManagerNames.append(user.getName()); depositoryManagerNames.append(user.getName());
} }
// 设置使用部门为第一个审批节点人所在的部门
applicationOutRecordPById.setUseAdminorgName(useAdminorgName);
Integer adminorgId = applicationOutRecordPById.getAdminorgId(); Integer adminorgId = applicationOutRecordPById.getAdminorgId();
Integer constructionUnitId = applicationOutRecordPById.getConstructionUnitId(); Integer constructionUnitId = applicationOutRecordPById.getConstructionUnitId();
if (adminorgId != null) { if (adminorgId != null) {

7
src/main/java/com/dreamchaser/depository_manage/pojo/ApplicationOutRecordP.java

@ -204,10 +204,15 @@ public class ApplicationOutRecordP {
/** /**
* 部门名称 * 申请人部门名称
*/ */
private String adminorgName; private String adminorgName;
/**
* 使用部门名称
*/
private String useAdminorgName;
/** /**
* 摘要 * 摘要
*/ */

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

@ -4738,6 +4738,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
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()); aorp.setAdminorgName(userByPortById.getMaindeparmentname());
result.add(aorp); result.add(aorp);
} }
return result; return result;

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

@ -56,9 +56,13 @@
<td id="depositoryName" th:text="${record.getDepositoryName()}">外芯仓库</td> <td id="depositoryName" th:text="${record.getDepositoryName()}">外芯仓库</td>
</tr> </tr>
<tr th:style="'display:'+${adisplay}"> <tr th:style="'display:'+${adisplay}">
<td>部门</td> <td>申请部门</td>
<td id="adminorg" th:text="${record.getAdminorgName()}">部门</td> <td id="adminorg" th:text="${record.getAdminorgName()}">部门</td>
</tr> </tr>
<tr >
<td>使用部门</td>
<td id="useAdminorg" th:text="${record.getUseAdminorgName()}">部门</td>
</tr>
<tr th:style="'display:'+${cdisplay}"> <tr th:style="'display:'+${cdisplay}">
<td>施工单位</td> <td>施工单位</td>
<td id="constructUnitId" th:text="${record.getConstructionUnitName()}">施工单位</td> <td id="constructUnitId" th:text="${record.getConstructionUnitName()}">施工单位</td>

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

@ -189,6 +189,7 @@
}, },
{field: 'applicantName', width: 150, title: '申请人'}, {field: 'applicantName', width: 150, title: '申请人'},
{field: 'adminorgName', width: 150, title: '申请人部门'}, {field: 'adminorgName', width: 150, title: '申请人部门'},
{field: 'useAdminorgName', 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) {

Loading…
Cancel
Save