服务计划-全部保存-只保留长者标签的存储与删除

This commit is contained in:
1378012178@qq.com 2025-11-06 16:15:58 +08:00
parent 0b3f522345
commit 497cf38ca0
2 changed files with 33 additions and 32 deletions

View File

@ -2,13 +2,14 @@ package com.nu.modules.NuBizNuCustomerServer.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.nu.modules.NuBizNuCustomerServer.entity.NuBizNuCustomerElderTag;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Description: 护理单元客户配置长者标签
* @Author: caolei
* @Date: 2025-10-13
* @Date: 2025-10-13
* @Version: V1.0
*/
public interface INuBizNuCustomerElderTagService extends IService<NuBizNuCustomerElderTag> {

View File

@ -285,39 +285,39 @@ public class NuBizNuCustomerServerServiceImpl extends ServiceImpl<NuBizNuCustome
//保存服务指令计划
String nuId = nuBizNuCustomerServer.getNuId();
String customerId = nuBizNuCustomerServer.getCustomerId();
QueryWrapper<NuBizNuCustomerServer> nuBizNuCustomerServerQueryWrapper = new QueryWrapper<>();
nuBizNuCustomerServerQueryWrapper.eq("nu_id", nuId);
nuBizNuCustomerServerQueryWrapper.eq("customer_id", customerId);
baseMapper.delete(nuBizNuCustomerServerQueryWrapper);
List<NuBizNuCustomerServer> serverList = nuBizNuCustomerServer.getServerList();
if (serverList.size() > 0) {
for (NuBizNuCustomerServer par : serverList) {
par.setNuId(nuId);
par.setNuName(nuBizNuCustomerServer.getNuName());
par.setCustomerId(customerId);
par.setCustomerName(nuBizNuCustomerServer.getCustomerName());
}
this.saveBatch(serverList);
}
QueryWrapper<NuBizNuCustomerServerInstant> instantQueryWrapper = new QueryWrapper<>();
instantQueryWrapper.eq("nu_id", nuId);
instantQueryWrapper.eq("customer_id", customerId);
nuBizNuCustomerServerInstantService.remove(instantQueryWrapper);
List<NuBizNuCustomerServerInstant> instantList = nuBizNuCustomerServer.getInstantList();
if (instantList.size() > 0) {
for (NuBizNuCustomerServerInstant pari : instantList) {
pari.setNuId(nuId);
pari.setNuName(nuBizNuCustomerServer.getNuName());
pari.setCustomerId(customerId);
pari.setCustomerName(nuBizNuCustomerServer.getCustomerName());
}
nuBizNuCustomerServerInstantService.saveBatch(instantList);
}
// QueryWrapper<NuBizNuCustomerServer> nuBizNuCustomerServerQueryWrapper = new QueryWrapper<>();
// nuBizNuCustomerServerQueryWrapper.eq("nu_id", nuId);
// nuBizNuCustomerServerQueryWrapper.eq("customer_id", customerId);
// baseMapper.delete(nuBizNuCustomerServerQueryWrapper);
// List<NuBizNuCustomerServer> serverList = nuBizNuCustomerServer.getServerList();
// if (serverList.size() > 0) {
// for (NuBizNuCustomerServer par : serverList) {
// par.setNuId(nuId);
// par.setNuName(nuBizNuCustomerServer.getNuName());
// par.setCustomerId(customerId);
// par.setCustomerName(nuBizNuCustomerServer.getCustomerName());
// }
//
// this.saveBatch(serverList);
// }
// QueryWrapper<NuBizNuCustomerServerInstant> instantQueryWrapper = new QueryWrapper<>();
// instantQueryWrapper.eq("nu_id", nuId);
// instantQueryWrapper.eq("customer_id", customerId);
// nuBizNuCustomerServerInstantService.remove(instantQueryWrapper);
// List<NuBizNuCustomerServerInstant> instantList = nuBizNuCustomerServer.getInstantList();
// if (instantList.size() > 0) {
// for (NuBizNuCustomerServerInstant pari : instantList) {
// pari.setNuId(nuId);
// pari.setNuName(nuBizNuCustomerServer.getNuName());
// pari.setCustomerId(customerId);
// pari.setCustomerName(nuBizNuCustomerServer.getCustomerName());
// }
// nuBizNuCustomerServerInstantService.saveBatch(instantList);
// }
QueryWrapper<NuBizNuCustomerElderTag> tagQueryWrapper = new QueryWrapper<>();
instantQueryWrapper.eq("nu_id", nuId);
instantQueryWrapper.eq("customer_id", customerId);
tagQueryWrapper.eq("nu_id", nuId);
tagQueryWrapper.eq("customer_id", customerId);
nuBizNuCustomerElderTagService.remove(tagQueryWrapper);
List<NuBizNuCustomerElderTag> tagList = nuBizNuCustomerServer.getTagList();
if (tagList.size() > 0) {