From d3830805113d4303dcc5aaad671b5167e9b2e188 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期日, 01 十二月 2024 22:26:44 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/funingyunwei
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwWorkorderServiceImpl.java | 59 +++++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 47 insertions(+), 12 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwWorkorderServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwWorkorderServiceImpl.java
index dfa5cd2..3d2b0b5 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwWorkorderServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwWorkorderServiceImpl.java
@@ -66,6 +66,7 @@
model.setIsdeleted(Constants.ZERO);
model.setCreateDate(new Date());
model.setStatus(Constants.ZERO);
+ model.setDealStatus(Constants.ZERO);
model.setEditDate(model.getCreateDate());
model.setEditor(model.getCreator());
ywWorkorderMapper.insert(model);
@@ -78,11 +79,12 @@
if(StringUtils.isBlank(multifile.getFileurl())){
continue;
}
- multifile.setCreateDate(new Date());
+ multifile.setCreateDate(model.getCreateDate());
+ multifile.setEditDate(model.getCreateDate());
multifile.setCreator(model.getEditor());
multifile.setIsdeleted(Constants.ZERO);
multifile.setObjId(model.getId());
- multifile.setCreator(model.getCreator());
+ multifile.setEditor(model.getCreator());
multifile.setObjType(Constants.MultiFile.YW_WORKORDER_PROBLEM.getKey());
multifile.setSortnum(i+1);
fileList.add(multifile);
@@ -168,7 +170,9 @@
if(model ==null || Constants.equalsInteger(model.getIsdeleted(),Constants.ONE)){
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝宸ュ崟淇℃伅涓嶅瓨鍦紒");
}
- if(!Constants.equalsInteger(model.getDealStatus(),Constants.ZERO) && !Constants.equalsInteger(model.getDealStatus(),Constants.ONE)){
+ if(!Constants.equalsInteger(model.getDealStatus(),Constants.ZERO)
+// && !Constants.equalsInteger(model.getDealStatus(),Constants.ONE)
+ ){
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝宸ュ崟鐘舵�佸凡娴佽浆锛屼笉鏀寔褰撳墠鎿嶄綔锛�");
}
@@ -184,8 +188,9 @@
update.setDispatchUserId(update.getEditor());
update.setDispatchDate(update.getEditDate());
update.setDispatchInfo(ywWorkorder.getDispatchInfo());
+ update.setDealUserId(ywWorkorder.getDealUserId());
ywWorkorderMapper.updateById(update);
- dealLogBiz(model,Constants.YwLogType.WORKORDER_DISPATCH,model.getLoginUserInfo().getRealname(),user.getRealname());//璁板綍鏂板缓鏃ュ織
+ dealLogBiz(model,Constants.YwLogType.WORKORDER_DISPATCH,ywWorkorder.getLoginUserInfo().getRealname(),user.getRealname());//璁板綍鏂板缓鏃ュ織
}
@Override
@Transactional(rollbackFor = {BusinessException.class,Exception.class})
@@ -198,10 +203,10 @@
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝宸ュ崟鐘舵�佸凡娴佽浆锛屼笉鏀寔褰撳墠鎿嶄綔锛�");
}
- SystemUser user = systemUserMapper.selectById(ywWorkorder.getDealUserId());
- if(user ==null || (user.getDeleted()!=null&& user.getDeleted() )){
- throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝鍛樺伐淇℃伅涓嶅瓨鍦紒");
- }
+// SystemUser user = systemUserMapper.selectById(ywWorkorder.getDealUserId());
+// if(user ==null || (user.getDeleted()!=null&& user.getDeleted() )){
+// throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝鍛樺伐淇℃伅涓嶅瓨鍦紒");
+// }
YwWorkorder update = new YwWorkorder();
update.setId(model.getId());
update.setEditDate(new Date());
@@ -209,9 +214,31 @@
update.setDealStatus(Constants.TWO);
update.setDealUserId(update.getEditor());
update.setDealDate(update.getEditDate());
- update.setDealInfo(ywWorkorder.getDispatchInfo());
+ update.setDealInfo(ywWorkorder.getDealInfo());
ywWorkorderMapper.updateById(update);
- dealLogBiz(model,Constants.YwLogType.WORKORDER_DEAL,model.getLoginUserInfo().getRealname(),null);//璁板綍鏂板缓鏃ュ織
+
+ List<Multifile> fileList = new ArrayList<>();
+ if(ywWorkorder.getDealFileList()!=null && ywWorkorder.getDealFileList().size()>0){
+ for (int i = 0; i < ywWorkorder.getDealFileList().size(); i++) {
+ Multifile multifile = ywWorkorder.getDealFileList().get(i);
+ if(StringUtils.isBlank(multifile.getFileurl())){
+ continue;
+ }
+ multifile.setCreateDate(update.getEditDate());
+ multifile.setCreator(update.getEditor());
+ multifile.setEditDate(update.getEditDate());
+ multifile.setIsdeleted(Constants.ZERO);
+ multifile.setObjId(model.getId());
+ multifile.setEditor(update.getEditor());
+ multifile.setObjType(Constants.MultiFile.YW_WORKORDER_DEAL.getKey());
+ multifile.setSortnum(i+1);
+ fileList.add(multifile);
+ }
+ }
+ if(fileList.size()>0){
+ multifileMapper.insert(fileList);
+ }
+ dealLogBiz(model,Constants.YwLogType.WORKORDER_DEAL,ywWorkorder.getLoginUserInfo().getRealname(),null);//璁板綍鏂板缓鏃ュ織
}
@Override
@Transactional(rollbackFor = {BusinessException.class,Exception.class})
@@ -348,16 +375,23 @@
.selectAs(YwRoom::getRoomNum,YwWorkorder::getRoomNum)
.selectAs(YwFloor::getName,YwWorkorder::getFloorName)
.selectAs(YwBuilding::getName,YwWorkorder::getBuildingName)
+ .selectAs(YwProject::getName,YwWorkorder::getProjectName)
.leftJoin(SystemUser.class,SystemUser::getId,YwWorkorder::getDealUserId)
.leftJoin(Category.class,Category::getId,YwWorkorder::getCateId)
.leftJoin(SystemUser.class,SystemUser::getId,YwWorkorder::getCreator)
.leftJoin(YwRoom.class,YwRoom::getId,YwWorkorder::getRoomId)
.leftJoin(YwFloor.class,YwFloor::getId,YwWorkorder::getFloorId)
- .leftJoin(YwBuilding.class,YwBuilding::getId,YwWorkorder::getBuildingId);
+ .leftJoin(YwBuilding.class,YwBuilding::getId,YwWorkorder::getBuildingId)
+ .leftJoin(YwProject.class,YwProject::getId,YwBuilding::getProjectId);
pageWrap.getModel().setIsdeleted(Constants.ZERO);
Utils.MP.blankToNull(pageWrap.getModel());
if (pageWrap.getModel().getId() != null) {
queryWrapper.eq(YwWorkorder::getId, pageWrap.getModel().getId());
+ }
+ if(Objects.nonNull(pageWrap.getModel().getRoomName())){
+ queryWrapper.and(i->i.like(YwFloor::getName,pageWrap.getModel().getRoomName()).or()
+ .like(YwRoom::getRoomNum,pageWrap.getModel().getRoomName())
+ );
}
if (pageWrap.getModel().getCreator() != null) {
queryWrapper.eq(YwWorkorder::getCreator, pageWrap.getModel().getCreator());
@@ -383,7 +417,8 @@
queryWrapper.eq(YwWorkorder::getRemark, pageWrap.getModel().getRemark());
}
if (pageWrap.getModel().getStatus() != null) {
- queryWrapper.eq(YwWorkorder::getStatus, pageWrap.getModel().getStatus());
+ queryWrapper.eq(!Constants.equalsInteger(pageWrap.getModel().getStatus(),-1),YwWorkorder::getStatus, pageWrap.getModel().getStatus());
+ queryWrapper.in(Constants.equalsInteger(pageWrap.getModel().getStatus(),-1),YwWorkorder::getStatus, Constants.ZERO,Constants.ONE);
}
if (pageWrap.getModel().getSortnum() != null) {
queryWrapper.eq(YwWorkorder::getSortnum, pageWrap.getModel().getSortnum());
--
Gitblit v1.9.3