md
This commit is contained in:
parent
34691bc2a2
commit
41908a30c8
@ -116,40 +116,103 @@ public class EmisCustomerUserController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增快递客户用户
|
* 新增现金客户
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('emis:emisCustomerUser:add')")
|
@PreAuthorize("@ss.hasPermi('emis:emisCustomerUser:add')")
|
||||||
@Log(title = "快递客户用户", businessType = BusinessType.INSERT)
|
@Log(title = "新增现金客户", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping("/addMoneyUser")
|
||||||
public AjaxResult add(@RequestBody EmisCustomerUser emisCustomerUser)
|
public AjaxResult addMoneyUser(@RequestBody EmisCustomerUser emisCustomerUser)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
EmisCustomerUser oldUser=emisBaseService.getCustomerUserByPhone(emisCustomerUser.getPhone());
|
EmisCustomerUser oldUser=emisBaseService.getCustomerUserByPhone(emisCustomerUser.getPhone());
|
||||||
if(oldUser!=null){
|
if(oldUser!=null){
|
||||||
return AjaxResult.error("该客户电话号码已被占用,请使用新号码");
|
return AjaxResult.error("该客户电话号码已被占用,请使用新号码");
|
||||||
}
|
}
|
||||||
|
emisCustomerUser.setCustomerType("1");
|
||||||
|
emisCustomerUser.setSettledType("1");
|
||||||
|
emisCustomerUser.setUserType("1");
|
||||||
return toAjax(emisCustomerUserService.insertEmisCustomerUser(emisCustomerUser));
|
return toAjax(emisCustomerUserService.insertEmisCustomerUser(emisCustomerUser));
|
||||||
} catch (DuplicateKeyException e) {
|
} catch (DuplicateKeyException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return AjaxResult.error("数据重复!");
|
return AjaxResult.error("数据重复!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改月结客户
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('emis:emisCustomerUser:edit')")
|
||||||
|
@Log(title = "修改现金客户", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/editMoneyUser")
|
||||||
|
public AjaxResult editMoneyUser(@RequestBody EmisCustomerUser emisCustomerUser)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
EmisCustomerUser oldUser=emisBaseService.getCustomerUserByPhone(emisCustomerUser.getPhone());
|
||||||
|
if(oldUser!=null && !oldUser.getCustomerCode().equals(emisCustomerUser.getCustomerCode())){
|
||||||
|
return AjaxResult.error("该客户电话号码已被占用,请使用新号码");
|
||||||
|
}
|
||||||
|
|
||||||
|
emisCustomerUser.setCustomerType("1");
|
||||||
|
emisCustomerUser.setSettledType("1");
|
||||||
|
emisCustomerUser.setUserType("1");
|
||||||
|
|
||||||
|
return toAjax(emisCustomerUserService.updateEmisCustomerUser(emisCustomerUser));
|
||||||
|
} catch (DuplicateKeyException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return AjaxResult.error("数据重复!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增月结用户
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('emis:emisCustomerUser:add')")
|
||||||
|
@Log(title = "新增月结用户", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/addMonthUser")
|
||||||
|
public AjaxResult addMonthUser(@RequestBody EmisCustomerUser emisCustomerUser)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
EmisCustomerUser oldUser=emisBaseService.getCustomerUserByPhone(emisCustomerUser.getPhone());
|
||||||
|
if(oldUser!=null){
|
||||||
|
return AjaxResult.error("该客户电话号码已被占用,请使用新号码");
|
||||||
|
}
|
||||||
|
|
||||||
|
oldUser=emisBaseService.getCustomerUserByMonthlyPayCode(emisCustomerUser.getMonthlyPayCode());
|
||||||
|
if(oldUser!=null){
|
||||||
|
return AjaxResult.error("月结卡号已存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return toAjax(emisCustomerUserService.insertEmisCustomerUser(emisCustomerUser));
|
||||||
|
} catch (DuplicateKeyException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return AjaxResult.error("数据重复!");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改快递客户用户
|
* 修改月结客户
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('emis:emisCustomerUser:edit')")
|
@PreAuthorize("@ss.hasPermi('emis:emisCustomerUser:edit')")
|
||||||
@Log(title = "快递客户用户", businessType = BusinessType.UPDATE)
|
@Log(title = "修改月结客户", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping("/editMonthUser")
|
||||||
public AjaxResult edit(@RequestBody EmisCustomerUser emisCustomerUser)
|
public AjaxResult editMonthUser(@RequestBody EmisCustomerUser emisCustomerUser)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
// EmisCustomerUser oldUser=emisBaseService.getCustomerUserByPhone(emisCustomerUser.getPhone());
|
EmisCustomerUser oldUser=emisBaseService.getCustomerUserByPhone(emisCustomerUser.getPhone());
|
||||||
// if(oldUser!=null){
|
if(oldUser!=null && !oldUser.getCustomerCode().equals(emisCustomerUser.getCustomerCode())){
|
||||||
// return AjaxResult.error("该客户电话号码已被占用,请使用新号码");
|
return AjaxResult.error("该客户电话号码已被占用,请使用新号码");
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
oldUser=emisBaseService.getCustomerUserByMonthlyPayCode(emisCustomerUser.getMonthlyPayCode());
|
||||||
|
if(oldUser!=null && !oldUser.getCustomerCode().equals(emisCustomerUser.getCustomerCode())){
|
||||||
|
return AjaxResult.error("月结卡号已存在");
|
||||||
|
}
|
||||||
|
|
||||||
return toAjax(emisCustomerUserService.updateEmisCustomerUser(emisCustomerUser));
|
return toAjax(emisCustomerUserService.updateEmisCustomerUser(emisCustomerUser));
|
||||||
} catch (DuplicateKeyException e) {
|
} catch (DuplicateKeyException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user