|
|
@@ -20,6 +20,7 @@ import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.demand.bo.DemandOrderListBo;
|
|
|
+import com.goafanti.demand.bo.OrgDemandOrderListBo;
|
|
|
import com.goafanti.demand.bo.UserDemandOrderListBo;
|
|
|
import com.goafanti.demand.service.DemandOrderService;
|
|
|
|
|
|
@@ -62,13 +63,6 @@ public class DemandOrderServiceImpl extends BaseMybatisDao<DemandOrderMapper> im
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<DemandOrderListBo> listOrderList(Integer status, Integer pNo, Integer pSize) {
|
|
|
- Map<String, Object> params = new HashMap<>();
|
|
|
-
|
|
|
- if (null != status) {
|
|
|
- params.put("status", status);
|
|
|
- }
|
|
|
-
|
|
|
- params.put("uid", TokenManager.getUserId());
|
|
|
|
|
|
if (pNo == null || pNo < 0) {
|
|
|
pNo = 1;
|
|
|
@@ -77,8 +71,8 @@ public class DemandOrderServiceImpl extends BaseMybatisDao<DemandOrderMapper> im
|
|
|
if (pSize == null || pSize < 0 || pSize > 10) {
|
|
|
pSize = 10;
|
|
|
}
|
|
|
- return (Pagination<DemandOrderListBo>) findPage("findDemandOrderListByPage", "findDemandOrderCount", params,
|
|
|
- pNo, pSize);
|
|
|
+ return (Pagination<DemandOrderListBo>) findPage("findDemandOrderListByPage", "findDemandOrderCount",
|
|
|
+ disposeDemandOrderList(null, null, null, status, false), pNo, pSize);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -96,31 +90,59 @@ public class DemandOrderServiceImpl extends BaseMybatisDao<DemandOrderMapper> im
|
|
|
@Override
|
|
|
public Pagination<UserDemandOrderListBo> listUserDemandOrder(String uid, String username, Integer status,
|
|
|
Integer pNo, Integer pSize) {
|
|
|
+
|
|
|
+ if (pNo == null || pNo < 0) {
|
|
|
+ pNo = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pSize == null || pSize < 0 || pSize > 10) {
|
|
|
+ pSize = 10;
|
|
|
+ }
|
|
|
+ return (Pagination<UserDemandOrderListBo>) findPage("findUserDemandOrderListByPage", "findUserDemandOrderCount",
|
|
|
+ disposeDemandOrderList(uid, username, null, status, true), pNo, pSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ @Override
|
|
|
+ public Pagination<OrgDemandOrderListBo> listOrgDemandOrder(String uid, String unitName, Integer status, Integer pNo,
|
|
|
+ Integer pSize) {
|
|
|
+ if (pNo == null || pNo < 0) {
|
|
|
+ pNo = 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (pSize == null || pSize < 0 || pSize > 10) {
|
|
|
+ pSize = 10;
|
|
|
+ }
|
|
|
+ return (Pagination<OrgDemandOrderListBo>) findPage("findOrgDemandOrderListByPage", "findOrgDemandOrderCount",
|
|
|
+ disposeDemandOrderList(uid, null, unitName, status, true), pNo, pSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ private Map<String, Object> disposeDemandOrderList(String uid, String username, String unitName, Integer status,
|
|
|
+ Boolean flag) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
|
|
|
if (null != status) {
|
|
|
params.put("status", status);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (!StringUtils.isBlank(uid)) {
|
|
|
params.put("uid", uid);
|
|
|
}
|
|
|
-
|
|
|
- if (!StringUtils.isBlank(username)){
|
|
|
+
|
|
|
+ if (!StringUtils.isBlank(username)) {
|
|
|
params.put("username", username);
|
|
|
}
|
|
|
-
|
|
|
- params.put("techBrokerId", TokenManager.getAdminId());
|
|
|
-
|
|
|
- if (pNo == null || pNo < 0) {
|
|
|
- pNo = 1;
|
|
|
- }
|
|
|
|
|
|
- if (pSize == null || pSize < 0 || pSize > 10) {
|
|
|
- pSize = 10;
|
|
|
+ if (!StringUtils.isBlank(unitName)) {
|
|
|
+ params.put("unitName", unitName);
|
|
|
}
|
|
|
- return (Pagination<UserDemandOrderListBo>) findPage("findUserDemandOrderListByPage", "findUserDemandOrderCount", params,
|
|
|
- pNo, pSize);
|
|
|
+ if (flag) {
|
|
|
+ params.put("techBrokerId", TokenManager.getAdminId());
|
|
|
+ } else {
|
|
|
+ params.put("uid", TokenManager.getUserId());
|
|
|
+ }
|
|
|
+
|
|
|
+ return params;
|
|
|
}
|
|
|
|
|
|
}
|