|
|
|
@ -9,11 +9,8 @@ import java.io.UnsupportedEncodingException; |
|
|
|
|
import java.net.URLDecoder; |
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
|
|
import org.apache.shiro.SecurityUtils; |
|
|
|
|
import org.jeecg.common.api.vo.Result; |
|
|
|
|
import org.jeecg.common.system.query.QueryGenerator; |
|
|
|
|
import org.jeecg.common.system.vo.LoginUser; |
|
|
|
|
import org.jeecg.common.util.oConvertUtils; |
|
|
|
|
import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress; |
|
|
|
|
import org.jeecg.modules.demo.customerreceivingaddress.service.ICustomerReceivingAddressService; |
|
|
|
@ -42,7 +39,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
|
/** |
|
|
|
|
* @Description: 顾客地址表 |
|
|
|
|
* @Author: jeecg-boot |
|
|
|
|
* @Date: 2022-12-05 |
|
|
|
|
* @Date: 2022-12-22 |
|
|
|
|
* @Version: V1.0 |
|
|
|
|
*/ |
|
|
|
|
@Api(tags="顾客地址表") |
|
|
|
@ -52,7 +49,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
|
public class CustomerReceivingAddressController extends JeecgController<CustomerReceivingAddress, ICustomerReceivingAddressService> { |
|
|
|
|
@Autowired |
|
|
|
|
private ICustomerReceivingAddressService customerReceivingAddressService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页列表查询 |
|
|
|
|
* |
|
|
|
@ -74,35 +71,7 @@ public class CustomerReceivingAddressController extends JeecgController<Customer |
|
|
|
|
IPage<CustomerReceivingAddress> pageList = customerReceivingAddressService.page(page, queryWrapper); |
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页列表查询 |
|
|
|
|
* |
|
|
|
|
* @param customerReceivingAddress |
|
|
|
|
* @param pageNo |
|
|
|
|
* @param pageSize |
|
|
|
|
* @param req |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "顾客地址表-分页列表查询") |
|
|
|
|
@ApiOperation(value="顾客地址表-分页列表查询", notes="顾客地址表-分页列表查询") |
|
|
|
|
@GetMapping(value = "/listcustom") |
|
|
|
|
public Result<?> listcustom(CustomerReceivingAddress customerReceivingAddress, |
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
|
|
|
|
HttpServletRequest req) { |
|
|
|
|
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal(); |
|
|
|
|
QueryWrapper<CustomerReceivingAddress> queryWrapper = QueryGenerator.initQueryWrapper(customerReceivingAddress, req.getParameterMap()); |
|
|
|
|
queryWrapper.eq("createBy",sysUser.getUsername()); |
|
|
|
|
Page<CustomerReceivingAddress> page = new Page<CustomerReceivingAddress>(pageNo, pageSize); |
|
|
|
|
IPage<CustomerReceivingAddress> pageList = customerReceivingAddressService.page(page, queryWrapper); |
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 添加 |
|
|
|
|
* |
|
|
|
@ -113,14 +82,14 @@ public class CustomerReceivingAddressController extends JeecgController<Customer |
|
|
|
|
@ApiOperation(value="顾客地址表-添加", notes="顾客地址表-添加") |
|
|
|
|
@PostMapping(value = "/add") |
|
|
|
|
public Result<?> add(@RequestBody CustomerReceivingAddress customerReceivingAddress) { |
|
|
|
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
|
|
|
|
if(customerReceivingAddress.getReceiver()=="" || customerReceivingAddress.getReceiver()==null ){ |
|
|
|
|
customerReceivingAddress.setReceiver(loginUser.getUsername()); |
|
|
|
|
if(customerReceivingAddress.getSort()<0){ |
|
|
|
|
return Result.error("排序数字必须大于0!"); |
|
|
|
|
}else { |
|
|
|
|
customerReceivingAddressService.save(customerReceivingAddress); |
|
|
|
|
return Result.OK("添加成功!"); |
|
|
|
|
} |
|
|
|
|
customerReceivingAddressService.save(customerReceivingAddress); |
|
|
|
|
return Result.OK("添加成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 编辑 |
|
|
|
|
* |
|
|
|
@ -131,10 +100,14 @@ public class CustomerReceivingAddressController extends JeecgController<Customer |
|
|
|
|
@ApiOperation(value="顾客地址表-编辑", notes="顾客地址表-编辑") |
|
|
|
|
@PutMapping(value = "/edit") |
|
|
|
|
public Result<?> edit(@RequestBody CustomerReceivingAddress customerReceivingAddress) { |
|
|
|
|
customerReceivingAddressService.updateById(customerReceivingAddress); |
|
|
|
|
return Result.OK("编辑成功!"); |
|
|
|
|
if(customerReceivingAddress.getSort()<0){ |
|
|
|
|
return Result.error("排序数字必须大于0!"); |
|
|
|
|
}else { |
|
|
|
|
customerReceivingAddressService.updateById(customerReceivingAddress); |
|
|
|
|
return Result.OK("编辑成功!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过id删除 |
|
|
|
|
* |
|
|
|
@ -148,7 +121,7 @@ public class CustomerReceivingAddressController extends JeecgController<Customer |
|
|
|
|
customerReceivingAddressService.removeById(id); |
|
|
|
|
return Result.OK("删除成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 批量删除 |
|
|
|
|
* |
|
|
|
@ -162,7 +135,7 @@ public class CustomerReceivingAddressController extends JeecgController<Customer |
|
|
|
|
this.customerReceivingAddressService.removeByIds(Arrays.asList(ids.split(","))); |
|
|
|
|
return Result.OK("批量删除成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过id查询 |
|
|
|
|
* |
|
|
|
|