|
|
@@ -63,64 +63,14 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
|
|
|
public Pagination<ContractManageListBo> getManageList(String contractId, Integer serialNumber, Integer type,
|
|
|
Integer status, String startDateFormattedDate, String endDateFormattedDate, String province,
|
|
|
String unitName, String uid, Integer pNo, Integer pSize) {
|
|
|
- Date cStart = null;
|
|
|
- Date cEnd = null;
|
|
|
-
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
-
|
|
|
+ Map<String, Object> params = disposeParams(contractId, serialNumber, type,
|
|
|
+ status, startDateFormattedDate, endDateFormattedDate, province,
|
|
|
+ unitName, uid);
|
|
|
+
|
|
|
if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
|
|
|
params.put("principal", TokenManager.getAdminId());
|
|
|
}
|
|
|
-
|
|
|
- if (null != serialNumber) {
|
|
|
- params.put("serialNumber", serialNumber);
|
|
|
- }
|
|
|
-
|
|
|
- if (null != type) {
|
|
|
- params.put("type", type);
|
|
|
- }
|
|
|
-
|
|
|
- if (null != status) {
|
|
|
- params.put("status", status);
|
|
|
- }
|
|
|
-
|
|
|
- if (!StringUtils.isBlank(uid)) {
|
|
|
- params.put("uid", uid);
|
|
|
- }
|
|
|
-
|
|
|
- if (!StringUtils.isBlank(contractId)) {
|
|
|
- params.put("id", contractId);
|
|
|
- }
|
|
|
-
|
|
|
- if (!StringUtils.isBlank(startDateFormattedDate)) {
|
|
|
- try {
|
|
|
- cStart = DateUtils.parseDate(startDateFormattedDate, AFTConstants.YYYYMMDD);
|
|
|
- } catch (ParseException e) {
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (null != cStart) {
|
|
|
- params.put("cStart", cStart);
|
|
|
- }
|
|
|
-
|
|
|
- if (!StringUtils.isBlank(endDateFormattedDate)) {
|
|
|
- try {
|
|
|
- cEnd = DateUtils.parseDate(endDateFormattedDate, AFTConstants.YYYYMMDD);
|
|
|
- } catch (ParseException e) {
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (null != cEnd) {
|
|
|
- params.put("cEnd", cEnd);
|
|
|
- }
|
|
|
-
|
|
|
- if (!StringUtils.isBlank(province)) {
|
|
|
- params.put("province", province);
|
|
|
- }
|
|
|
-
|
|
|
- if (!StringUtils.isBlank(unitName)) {
|
|
|
- params.put("unitName", unitName);
|
|
|
- }
|
|
|
+
|
|
|
if (pNo == null || pNo < 0) {
|
|
|
pNo = 1;
|
|
|
}
|
|
|
@@ -137,50 +87,11 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
|
|
|
@Override
|
|
|
public Pagination<ContractClientListBo> getClientList(String contractId, Integer serialNumber, Integer type,
|
|
|
Integer status, String startDateFormattedDate, String endDateFormattedDate, Integer pNo, Integer pSize) {
|
|
|
- Date cStart = null;
|
|
|
- Date cEnd = null;
|
|
|
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
+ Map<String, Object> params = disposeParams(contractId, serialNumber, type,
|
|
|
+ status, startDateFormattedDate, endDateFormattedDate, null,
|
|
|
+ null, TokenManager.getUserId());
|
|
|
|
|
|
- params.put("uid", TokenManager.getUserId());
|
|
|
-
|
|
|
- if (null != serialNumber) {
|
|
|
- params.put("serialNumber", serialNumber);
|
|
|
- }
|
|
|
-
|
|
|
- if (null != type) {
|
|
|
- params.put("type", type);
|
|
|
- }
|
|
|
-
|
|
|
- if (null != status) {
|
|
|
- params.put("status", status);
|
|
|
- }
|
|
|
-
|
|
|
- if (!StringUtils.isBlank(contractId)) {
|
|
|
- params.put("id", contractId);
|
|
|
- }
|
|
|
-
|
|
|
- if (!StringUtils.isBlank(startDateFormattedDate)) {
|
|
|
- try {
|
|
|
- cStart = DateUtils.parseDate(startDateFormattedDate, AFTConstants.YYYYMMDD);
|
|
|
- } catch (ParseException e) {
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (null != cStart) {
|
|
|
- params.put("cStart", cStart);
|
|
|
- }
|
|
|
-
|
|
|
- if (!StringUtils.isBlank(endDateFormattedDate)) {
|
|
|
- try {
|
|
|
- cEnd = DateUtils.parseDate(endDateFormattedDate, AFTConstants.YYYYMMDD);
|
|
|
- } catch (ParseException e) {
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (null != cEnd) {
|
|
|
- params.put("cEnd", cEnd);
|
|
|
- }
|
|
|
|
|
|
if (pNo == null || pNo < 0) {
|
|
|
pNo = 1;
|
|
|
@@ -376,5 +287,67 @@ public class ContractServiceImpl extends BaseMybatisDao<ContractMapper> implemen
|
|
|
c.setDeletedSign(DeleteStatus.UNDELETE.getCode());
|
|
|
return c;
|
|
|
}
|
|
|
+
|
|
|
+ private Map<String, Object> disposeParams(String contractId, Integer serialNumber, Integer type,
|
|
|
+ Integer status, String startDateFormattedDate, String endDateFormattedDate, String province,
|
|
|
+ String unitName, String uid){
|
|
|
+ Date cStart = null;
|
|
|
+ Date cEnd = null;
|
|
|
+
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (null != serialNumber) {
|
|
|
+ params.put("serialNumber", serialNumber);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null != type) {
|
|
|
+ params.put("type", type);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null != status) {
|
|
|
+ params.put("status", status);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!StringUtils.isBlank(uid)) {
|
|
|
+ params.put("uid", uid);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!StringUtils.isBlank(contractId)) {
|
|
|
+ params.put("id", contractId);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!StringUtils.isBlank(startDateFormattedDate)) {
|
|
|
+ try {
|
|
|
+ cStart = DateUtils.parseDate(startDateFormattedDate, AFTConstants.YYYYMMDD);
|
|
|
+ } catch (ParseException e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null != cStart) {
|
|
|
+ params.put("cStart", cStart);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!StringUtils.isBlank(endDateFormattedDate)) {
|
|
|
+ try {
|
|
|
+ cEnd = DateUtils.parseDate(endDateFormattedDate, AFTConstants.YYYYMMDD);
|
|
|
+ } catch (ParseException e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null != cEnd) {
|
|
|
+ params.put("cEnd", cEnd);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!StringUtils.isBlank(province)) {
|
|
|
+ params.put("province", province);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!StringUtils.isBlank(unitName)) {
|
|
|
+ params.put("unitName", unitName);
|
|
|
+ }
|
|
|
+ return params;
|
|
|
+ }
|
|
|
|
|
|
}
|