|
|
|
@ -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.customerpayment.entity.CustomerPayment; |
|
|
|
|
import org.jeecg.modules.demo.customerpayment.service.ICustomerPaymentService; |
|
|
|
@ -23,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
|
|
|
|
import org.jeecg.modules.demo.customerpayment.utils.BankUtil; |
|
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil; |
|
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
|
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams; |
|
|
|
@ -42,7 +40,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
|
/** |
|
|
|
|
* @Description: 顾客支付信息管理 |
|
|
|
|
* @Author: jeecg-boot |
|
|
|
|
* @Date: 2022-12-03 |
|
|
|
|
* @Date: 2022-12-21 |
|
|
|
|
* @Version: V1.0 |
|
|
|
|
*/ |
|
|
|
|
@Api(tags="顾客支付信息管理") |
|
|
|
@ -52,7 +50,7 @@ import org.jeecg.common.aspect.annotation.AutoLog; |
|
|
|
|
public class CustomerPaymentController extends JeecgController<CustomerPayment, ICustomerPaymentService> { |
|
|
|
|
@Autowired |
|
|
|
|
private ICustomerPaymentService customerPaymentService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页列表查询 |
|
|
|
|
* |
|
|
|
@ -74,33 +72,7 @@ public class CustomerPaymentController extends JeecgController<CustomerPayment, |
|
|
|
|
IPage<CustomerPayment> pageList = customerPaymentService.page(page, queryWrapper); |
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 分页列表查询 |
|
|
|
|
* |
|
|
|
|
* @param customerPayment |
|
|
|
|
* @param pageNo |
|
|
|
|
* @param pageSize |
|
|
|
|
* @param req |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@AutoLog(value = "顾客支付信息管理-分页列表查询") |
|
|
|
|
@ApiOperation(value="顾客支付信息管理-分页列表查询", notes="顾客支付信息管理-分页列表查询") |
|
|
|
|
@GetMapping(value = "/listcustom") |
|
|
|
|
public Result<?> listcustom(CustomerPayment customerPayment, |
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
|
|
|
|
HttpServletRequest req) { |
|
|
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
|
|
|
|
QueryWrapper<CustomerPayment> queryWrapper = QueryGenerator.initQueryWrapper(customerPayment, req.getParameterMap()); |
|
|
|
|
queryWrapper.eq("createBy",sysUser.getUsername()); |
|
|
|
|
Page<CustomerPayment> page = new Page<CustomerPayment>(pageNo, pageSize); |
|
|
|
|
IPage<CustomerPayment> pageList = customerPaymentService.page(page, queryWrapper); |
|
|
|
|
return Result.OK(pageList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 添加 |
|
|
|
|
* |
|
|
|
@ -111,10 +83,21 @@ public class CustomerPaymentController extends JeecgController<CustomerPayment, |
|
|
|
|
@ApiOperation(value="顾客支付信息管理-添加", notes="顾客支付信息管理-添加") |
|
|
|
|
@PostMapping(value = "/add") |
|
|
|
|
public Result<?> add(@RequestBody CustomerPayment customerPayment) { |
|
|
|
|
customerPaymentService.save(customerPayment); |
|
|
|
|
return Result.OK("添加成功!"); |
|
|
|
|
if(customerPayment.getPaymentType().equals("2")){ |
|
|
|
|
BankUtil bankUtil = new BankUtil(); |
|
|
|
|
if (bankUtil.checkBankCard(customerPayment.getAccountNo())){ |
|
|
|
|
customerPayment.setBankDeposit(bankUtil.getNameOfBank(customerPayment.getAccountNo())); |
|
|
|
|
customerPaymentService.save(customerPayment); |
|
|
|
|
return Result.OK("添加成功!你的银行开是"+bankUtil.getNameOfBank(customerPayment.getAccountNo())); |
|
|
|
|
}else { |
|
|
|
|
return Result.error("请检查银行卡号"); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
customerPaymentService.save(customerPayment); |
|
|
|
|
return Result.OK("添加成功!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 编辑 |
|
|
|
|
* |
|
|
|
@ -128,7 +111,7 @@ public class CustomerPaymentController extends JeecgController<CustomerPayment, |
|
|
|
|
customerPaymentService.updateById(customerPayment); |
|
|
|
|
return Result.OK("编辑成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过id删除 |
|
|
|
|
* |
|
|
|
@ -142,7 +125,7 @@ public class CustomerPaymentController extends JeecgController<CustomerPayment, |
|
|
|
|
customerPaymentService.removeById(id); |
|
|
|
|
return Result.OK("删除成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 批量删除 |
|
|
|
|
* |
|
|
|
@ -156,7 +139,7 @@ public class CustomerPaymentController extends JeecgController<CustomerPayment, |
|
|
|
|
this.customerPaymentService.removeByIds(Arrays.asList(ids.split(","))); |
|
|
|
|
return Result.OK("批量删除成功!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 通过id查询 |
|
|
|
|
* |
|
|
|
|