md
This commit is contained in:
parent
498132bbb7
commit
a60bf22b00
@ -48,7 +48,7 @@ public class Oms2cCustomerAddressController extends BaseController
|
|||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
// 只能查看自己的地址信息
|
// 只能查看自己的地址信息
|
||||||
emisCustomerAddress.setUserId(getLoginUser().getUser().getId());
|
// emisCustomerAddress.setUserId(getLoginUser().getUser().getId());
|
||||||
emisCustomerAddress.setCustomerCode(getLoginUser().getUser().getCustomerCode());
|
emisCustomerAddress.setCustomerCode(getLoginUser().getUser().getCustomerCode());
|
||||||
List<EmisCustomerAddress> list = emisCustomerAddressService.selectEmisCustomerAddressList(emisCustomerAddress);
|
List<EmisCustomerAddress> list = emisCustomerAddressService.selectEmisCustomerAddressList(emisCustomerAddress);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
@ -61,7 +61,7 @@ public class Oms2cCustomerAddressController extends BaseController
|
|||||||
{
|
{
|
||||||
// 需要限制,除总部外,只能查看站点自有数据
|
// 需要限制,除总部外,只能查看站点自有数据
|
||||||
startPage();
|
startPage();
|
||||||
emisCustomerAddress.setUserId(getLoginUser().getUser().getId());
|
// emisCustomerAddress.setUserId(getLoginUser().getUser().getId());
|
||||||
emisCustomerAddress.setCustomerCode(getLoginUser().getUser().getCustomerCode());
|
emisCustomerAddress.setCustomerCode(getLoginUser().getUser().getCustomerCode());
|
||||||
List<EmisCustomerAddress> list = emisCustomerAddressService.selectEmisCustomerAddressList(emisCustomerAddress);
|
List<EmisCustomerAddress> list = emisCustomerAddressService.selectEmisCustomerAddressList(emisCustomerAddress);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
@ -71,22 +71,35 @@ public class Oms2cCustomerAddressController extends BaseController
|
|||||||
@RequestMapping("/getAddressById")
|
@RequestMapping("/getAddressById")
|
||||||
public AjaxResult getAddressById(@RequestParam("id") Long id)
|
public AjaxResult getAddressById(@RequestParam("id") Long id)
|
||||||
{
|
{
|
||||||
return AjaxResult.success(emisCustomerAddressService.selectEmisCustomerAddressById(id));
|
EmisCustomerAddress emisCustomerAddress=emisCustomerAddressService.selectEmisCustomerAddressById(id);
|
||||||
|
if(!getLoginUser().getUser().getCustomerCode().equals(emisCustomerAddress.getCustomerCode())){
|
||||||
|
return AjaxResult.error("非法操作");
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.success(emisCustomerAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/setDefaultAddressById")
|
@RequestMapping("/setDefaultAddressById")
|
||||||
public AjaxResult setDefaultAddressById(@RequestParam("id") Long id,String defaultFlag)
|
public AjaxResult setDefaultAddressById(@RequestParam("id") Long id,String defaultFlag)
|
||||||
{
|
{
|
||||||
|
EmisCustomerAddress emisCustomerAddress=emisCustomerAddressService.selectEmisCustomerAddressById(id);
|
||||||
|
if(!getLoginUser().getUser().getCustomerCode().equals(emisCustomerAddress.getCustomerCode())){
|
||||||
|
return AjaxResult.error("非法操作");
|
||||||
|
}
|
||||||
|
|
||||||
return toAjax(emisCustomerAddressService.setDefaultAddressById(id,defaultFlag));
|
return toAjax(emisCustomerAddressService.setDefaultAddressById(id,defaultFlag));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/deleteAddressById")
|
@RequestMapping("/deleteAddressById")
|
||||||
public AjaxResult deleteAddressById(@RequestParam("id") Long id)
|
public AjaxResult deleteAddressById(@RequestParam("id") Long id)
|
||||||
{
|
{
|
||||||
return toAjax(emisCustomerAddressService.deleteEmisCustomerAddressById(id));
|
EmisCustomerAddress emisCustomerAddress=emisCustomerAddressService.selectEmisCustomerAddressById(id);
|
||||||
|
if(!getLoginUser().getUser().getCustomerCode().equals(emisCustomerAddress.getCustomerCode())){
|
||||||
|
return AjaxResult.error("非法操作");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return toAjax(emisCustomerAddressService.deleteEmisCustomerAddressById(id));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取客户收寄件地址详细信息
|
* 获取客户收寄件地址详细信息
|
||||||
@ -95,13 +108,18 @@ public class Oms2cCustomerAddressController extends BaseController
|
|||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
{
|
{
|
||||||
|
EmisCustomerAddress emisCustomerAddress=emisCustomerAddressService.selectEmisCustomerAddressById(id);
|
||||||
|
if(!getLoginUser().getUser().getCustomerCode().equals(emisCustomerAddress.getCustomerCode())){
|
||||||
|
return AjaxResult.error("非法操作");
|
||||||
|
}
|
||||||
|
|
||||||
return AjaxResult.success(emisCustomerAddressService.selectEmisCustomerAddressById(id));
|
return AjaxResult.success(emisCustomerAddressService.selectEmisCustomerAddressById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增客户收寄件地址
|
* 新增客户收寄件地址
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('emis:emisCustomerAddress:add')")
|
// @PreAuthorize("@ss.hasPermi('emis:emisCustomerAddress:add')")
|
||||||
@Log(title = "客户收寄件地址", businessType = BusinessType.INSERT)
|
@Log(title = "客户收寄件地址", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody EmisCustomerAddress emisCustomerAddress)
|
public AjaxResult add(@RequestBody EmisCustomerAddress emisCustomerAddress)
|
||||||
@ -124,28 +142,45 @@ public class Oms2cCustomerAddressController extends BaseController
|
|||||||
@PostMapping("/editAddress")
|
@PostMapping("/editAddress")
|
||||||
public AjaxResult editAddress(@RequestBody EmisCustomerAddress emisCustomerAddress)
|
public AjaxResult editAddress(@RequestBody EmisCustomerAddress emisCustomerAddress)
|
||||||
{
|
{
|
||||||
|
EmisCustomerAddress old=emisCustomerAddressService.selectEmisCustomerAddressById(emisCustomerAddress.getId());
|
||||||
|
if(!getLoginUser().getUser().getCustomerCode().equals(old.getCustomerCode())){
|
||||||
|
return AjaxResult.error("非法操作");
|
||||||
|
}
|
||||||
|
|
||||||
return toAjax(emisCustomerAddressService.updateEmisCustomerAddress(emisCustomerAddress));
|
return toAjax(emisCustomerAddressService.updateEmisCustomerAddress(emisCustomerAddress));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改客户收寄件地址
|
* 修改客户收寄件地址
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('emis:emisCustomerAddress:edit')")
|
// @PreAuthorize("@ss.hasPermi('emis:emisCustomerAddress:edit')")
|
||||||
@Log(title = "客户收寄件地址", businessType = BusinessType.UPDATE)
|
@Log(title = "客户收寄件地址", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody EmisCustomerAddress emisCustomerAddress)
|
public AjaxResult edit(@RequestBody EmisCustomerAddress emisCustomerAddress)
|
||||||
{
|
{
|
||||||
|
EmisCustomerAddress old=emisCustomerAddressService.selectEmisCustomerAddressById(emisCustomerAddress.getId());
|
||||||
|
if(!getLoginUser().getUser().getCustomerCode().equals(old.getCustomerCode())){
|
||||||
|
return AjaxResult.error("非法操作");
|
||||||
|
}
|
||||||
|
|
||||||
return toAjax(emisCustomerAddressService.updateEmisCustomerAddress(emisCustomerAddress));
|
return toAjax(emisCustomerAddressService.updateEmisCustomerAddress(emisCustomerAddress));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除客户收寄件地址
|
* 删除客户收寄件地址
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('emis:emisCustomerAddress:remove')")
|
// @PreAuthorize("@ss.hasPermi('emis:emisCustomerAddress:remove')")
|
||||||
@Log(title = "客户收寄件地址", businessType = BusinessType.DELETE)
|
@Log(title = "客户收寄件地址", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
{
|
{
|
||||||
|
for (Long id:ids
|
||||||
|
) {
|
||||||
|
EmisCustomerAddress old=emisCustomerAddressService.selectEmisCustomerAddressById(id);
|
||||||
|
if(!getLoginUser().getUser().getCustomerCode().equals(old.getCustomerCode())){
|
||||||
|
return AjaxResult.error("非法操作");
|
||||||
|
}
|
||||||
|
}
|
||||||
return toAjax(emisCustomerAddressService.deleteEmisCustomerAddressByIds(ids));
|
return toAjax(emisCustomerAddressService.deleteEmisCustomerAddressByIds(ids));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user