添加客户功能接口

This commit is contained in:
yangjun 2025-04-16 09:23:14 +08:00
parent 7657a7b8c6
commit b9375fc375
3 changed files with 77 additions and 0 deletions

View File

@ -177,4 +177,23 @@ public class NuBizCustomerInfoController extends JeecgController<NuBizCustomerIn
return super.importExcel(request, response, NuBizCustomerInfo.class);
}
@AutoLog(value = "客户信息-更换护理单元")
@ApiOperation(value="客户信息-更换护理单元", notes="客户信息-更换护理单元")
@RequiresPermissions("nuBizCustomerInfo:nu_biz_customer_info:edit")
@RequestMapping(value = "/editNu", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> editNu(@RequestBody NuBizCustomerInfo nuBizCustomerInfo) {
nuBizCustomerInfoService.editNu(nuBizCustomerInfo);
return Result.OK("编辑成功!");
}
@AutoLog(value = "客户信息-退住")
@ApiOperation(value="客户信息-退住", notes="客户信息-退住")
@RequiresPermissions("nuBizCustomerInfo:nu_biz_customer_info:edit")
@RequestMapping(value = "/editTuizhu", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> editTuizhu(@RequestBody NuBizCustomerInfo nuBizCustomerInfo) {
nuBizCustomerInfoService.editTuizhu(nuBizCustomerInfo);
return Result.OK("编辑成功!");
}
}

View File

@ -11,4 +11,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface INuBizCustomerInfoService extends IService<NuBizCustomerInfo> {
void editNu(NuBizCustomerInfo nuBizCustomerInfo);
void editTuizhu(NuBizCustomerInfo nuBizCustomerInfo);
}

View File

@ -1,12 +1,20 @@
package com.nu.modules.nuBizCustomerInfo.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.nu.modules.nuBaseInfo.entity.NuBaseInfo;
import com.nu.modules.nuBaseInfo.service.INuBaseInfoService;
import com.nu.modules.nuBizCustomerInfo.entity.NuBizCustomerInfo;
import com.nu.modules.nuBizCustomerInfo.mapper.NuBizCustomerInfoMapper;
import com.nu.modules.nuBizCustomerInfo.service.INuBizCustomerInfoService;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.Date;
/**
* @Description: 客户信息
* @Author: jeecg-boot
@ -15,5 +23,52 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
*/
@Service
public class NuBizCustomerInfoServiceImpl extends ServiceImpl<NuBizCustomerInfoMapper, NuBizCustomerInfo> implements INuBizCustomerInfoService {
@Autowired
private INuBaseInfoService nuBaseInfoService;
@Override
public void editNu(NuBizCustomerInfo nuBizCustomerInfo) {
NuBizCustomerInfo nuBizCustomerInfo1 = baseMapper.selectById(nuBizCustomerInfo.getId());
//修改原来护理单元状态
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
UpdateWrapper<NuBaseInfo> updateWrapper = new UpdateWrapper();
updateWrapper.set("customer_id",null);//清空客户id
updateWrapper.set("status","0");//重置成未使用状态
updateWrapper.set("update_time",new Date());
updateWrapper.set("update_by",sysUser.getUsername());
updateWrapper.eq("id",nuBizCustomerInfo1.getNuId());
nuBaseInfoService.update(updateWrapper);
//修改新的护理单元状态
UpdateWrapper<NuBaseInfo> updateWrapper1 = new UpdateWrapper();
updateWrapper1.set("customer_id",nuBizCustomerInfo.getId());//赋值客户id
updateWrapper1.set("status","1");//修改成使用状态
updateWrapper1.set("update_time",new Date());
updateWrapper1.set("update_by",sysUser.getUsername());
updateWrapper1.eq("id",nuBizCustomerInfo.getNuId());
nuBaseInfoService.update(updateWrapper1);
//修改客户护理单元
baseMapper.updateById(nuBizCustomerInfo);
//添加调整护理单元日志 todo
}
@Override
public void editTuizhu(NuBizCustomerInfo nuBizCustomerInfo) {
NuBizCustomerInfo nuBizCustomerInfo1 = baseMapper.selectById(nuBizCustomerInfo.getId());
//修改原来护理单元状态
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
UpdateWrapper<NuBaseInfo> updateWrapper = new UpdateWrapper();
updateWrapper.set("customer_id",null);//清空客户id
updateWrapper.set("status","0");//重置成未使用状态
updateWrapper.set("update_time",new Date());
updateWrapper.set("update_by",sysUser.getUsername());
updateWrapper.eq("id",nuBizCustomerInfo1.getNuId());
nuBaseInfoService.update(updateWrapper);
//修改客户护理单元
UpdateWrapper<NuBizCustomerInfo> updateTzWrapper = new UpdateWrapper();
updateTzWrapper.set("nu_id",null);
updateTzWrapper.set("current_state","3");
updateTzWrapper.eq("id",nuBizCustomerInfo.getId());
baseMapper.update(null, updateTzWrapper);
//添加调整护理单元日志 todo
}
}