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

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

View File

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