主财务单、财务细单接口开发
This commit is contained in:
parent
9b1132d171
commit
51539c8011
|
|
@ -79,6 +79,12 @@
|
||||||
<artifactId>ghy-order</artifactId>
|
<artifactId>ghy-order</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 财务模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ghy</groupId>
|
||||||
|
<artifactId>ghy-payment</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
||||||
|
|
@ -32,13 +32,13 @@ public class OrderDetailController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private OrderDetailService orderDetailService;
|
private OrderDetailService orderDetailService;
|
||||||
|
|
||||||
@RequiresPermissions("order:master:view")
|
@RequiresPermissions("order:detail:view")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public String orderDetail() {
|
public String orderDetail() {
|
||||||
return prefix;
|
return prefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresPermissions("order:master:list")
|
@RequiresPermissions("order:detail:list")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public TableDataInfo list(OrderDetail orderDetail) {
|
public TableDataInfo list(OrderDetail orderDetail) {
|
||||||
|
|
@ -48,7 +48,7 @@ public class OrderDetailController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "详细订单管理", businessType = BusinessType.EXPORT)
|
@Log(title = "详细订单管理", businessType = BusinessType.EXPORT)
|
||||||
@RequiresPermissions("order:master:export")
|
@RequiresPermissions("order:detail:export")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult export(OrderDetail orderDetail) {
|
public AjaxResult export(OrderDetail orderDetail) {
|
||||||
|
|
@ -57,7 +57,7 @@ public class OrderDetailController extends BaseController {
|
||||||
return util.exportExcel(list, "详细订单数据");
|
return util.exportExcel(list, "详细订单数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresPermissions("order:master:remove")
|
@RequiresPermissions("order:detail:remove")
|
||||||
@Log(title = "详细订单管理", businessType = BusinessType.DELETE)
|
@Log(title = "详细订单管理", businessType = BusinessType.DELETE)
|
||||||
@PostMapping("/remove")
|
@PostMapping("/remove")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
@ -72,7 +72,7 @@ public class OrderDetailController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 修改详细订单
|
* 修改详细订单
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("order:master:edit")
|
@RequiresPermissions("order:detail:edit")
|
||||||
@GetMapping("/edit/{orderDetailId}")
|
@GetMapping("/edit/{orderDetailId}")
|
||||||
public String edit(@PathVariable("orderDetailId") Long orderDetailId, ModelMap mmap) {
|
public String edit(@PathVariable("orderDetailId") Long orderDetailId, ModelMap mmap) {
|
||||||
mmap.put("orderDetail", orderDetailService.selectById(orderDetailId));
|
mmap.put("orderDetail", orderDetailService.selectById(orderDetailId));
|
||||||
|
|
@ -82,7 +82,7 @@ public class OrderDetailController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 修改保存详细订单
|
* 修改保存详细订单
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("order:master:edit")
|
@RequiresPermissions("order:detail:edit")
|
||||||
@Log(title = "详细订单管理", businessType = BusinessType.UPDATE)
|
@Log(title = "详细订单管理", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
package com.ghy.web.controller.payment;
|
||||||
|
|
||||||
|
import com.ghy.common.annotation.Log;
|
||||||
|
import com.ghy.common.constant.UserConstants;
|
||||||
|
import com.ghy.common.core.controller.BaseController;
|
||||||
|
import com.ghy.common.core.domain.AjaxResult;
|
||||||
|
import com.ghy.common.core.page.TableDataInfo;
|
||||||
|
import com.ghy.common.enums.BusinessType;
|
||||||
|
import com.ghy.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ghy.payment.domain.FinancialDetail;
|
||||||
|
import com.ghy.payment.service.FinancialDetailService;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 财务细单API
|
||||||
|
*
|
||||||
|
* @author HH 2022/4/25
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/financial/detail")
|
||||||
|
public class FinancialDetailController extends BaseController {
|
||||||
|
|
||||||
|
private final String prefix = "financial/detail";
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private FinancialDetailService financialDetailService;
|
||||||
|
|
||||||
|
@RequiresPermissions("financial:detail:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String financialDetail() {
|
||||||
|
return prefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("financial:detail:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(FinancialDetail financialDetail) {
|
||||||
|
startPage();
|
||||||
|
List<FinancialDetail> list = financialDetailService.selectFinancialDetailList(financialDetail);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "财务细单管理", businessType = BusinessType.EXPORT)
|
||||||
|
@RequiresPermissions("financial:detail:export")
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(FinancialDetail financialDetail) {
|
||||||
|
List<FinancialDetail> list = financialDetailService.selectFinancialDetailList(financialDetail);
|
||||||
|
ExcelUtil<FinancialDetail> util = new ExcelUtil<>(FinancialDetail.class);
|
||||||
|
return util.exportExcel(list, "财务细单数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("financial:detail:remove")
|
||||||
|
@Log(title = "财务细单管理", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids) {
|
||||||
|
try {
|
||||||
|
return toAjax(financialDetailService.deleteFinancialDetailByIds(ids));
|
||||||
|
} catch (Exception e) {
|
||||||
|
return error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改财务细单
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("financial:detail:edit")
|
||||||
|
@GetMapping("/edit/{financialDetailId}")
|
||||||
|
public String edit(@PathVariable("financialDetailId") Long financialDetailId, ModelMap mmap) {
|
||||||
|
mmap.put("financialDetail", financialDetailService.selectById(financialDetailId));
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存财务细单
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("financial:detail:edit")
|
||||||
|
@Log(title = "财务细单管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(@Validated FinancialDetail financialDetail) {
|
||||||
|
if (UserConstants.ORDER_CODE_NOT_UNIQUE.equals(financialDetailService.checkFinancialDetailCodeUnique(financialDetail))) {
|
||||||
|
return error("修改财务细单'" + financialDetail.getCode() + "'失败,财务细单编码已存在");
|
||||||
|
}
|
||||||
|
financialDetail.setUpdateBy(getLoginName());
|
||||||
|
return toAjax(financialDetailService.updateFinancialDetail(financialDetail));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验财务细单编码
|
||||||
|
*/
|
||||||
|
@PostMapping("/checkFinancialDetailCodeUnique")
|
||||||
|
@ResponseBody
|
||||||
|
public String checkFinancialDetailCodeUnique(FinancialDetail financialDetail) {
|
||||||
|
return financialDetailService.checkFinancialDetailCodeUnique(financialDetail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.ghy.web.controller.payment;
|
||||||
|
|
||||||
|
import com.ghy.common.annotation.Log;
|
||||||
|
import com.ghy.common.core.controller.BaseController;
|
||||||
|
import com.ghy.common.core.domain.AjaxResult;
|
||||||
|
import com.ghy.common.core.page.TableDataInfo;
|
||||||
|
import com.ghy.common.enums.BusinessType;
|
||||||
|
import com.ghy.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ghy.payment.domain.FinancialMaster;
|
||||||
|
import com.ghy.payment.service.FinancialMasterService;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主财务单API
|
||||||
|
*
|
||||||
|
* @author HH 2022/4/25
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/financial/master")
|
||||||
|
public class FinancialMasterController extends BaseController {
|
||||||
|
|
||||||
|
private final String prefix = "financial/master";
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private FinancialMasterService financialMasterService;
|
||||||
|
|
||||||
|
@RequiresPermissions("financial:master:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String financialMaster() {
|
||||||
|
return prefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("financial:master:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(FinancialMaster financialMaster) {
|
||||||
|
startPage();
|
||||||
|
List<FinancialMaster> list = financialMasterService.selectFinancialMasterList(financialMaster);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log(title = "主财务单管理", businessType = BusinessType.EXPORT)
|
||||||
|
@RequiresPermissions("financial:master:export")
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(FinancialMaster financialMaster) {
|
||||||
|
List<FinancialMaster> list = financialMasterService.selectFinancialMasterList(financialMaster);
|
||||||
|
ExcelUtil<FinancialMaster> util = new ExcelUtil<>(FinancialMaster.class);
|
||||||
|
return util.exportExcel(list, "主财务单数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("financial:master:remove")
|
||||||
|
@Log(title = "主财务单管理", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids) {
|
||||||
|
try {
|
||||||
|
return toAjax(financialMasterService.deleteFinancialMasterByIds(ids));
|
||||||
|
} catch (Exception e) {
|
||||||
|
return error(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改主财务单
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("financial:master:edit")
|
||||||
|
@GetMapping("/edit/{financialMasterId}")
|
||||||
|
public String edit(@PathVariable("financialMasterId") Long financialMasterId, ModelMap mmap) {
|
||||||
|
mmap.put("financialMaster", financialMasterService.selectById(financialMasterId));
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存主财务单
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("financial:master:edit")
|
||||||
|
@Log(title = "主财务单管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(@Validated FinancialMaster financialMaster) {
|
||||||
|
financialMaster.setUpdateBy(getLoginName());
|
||||||
|
return toAjax(financialMasterService.updateFinancialMaster(financialMaster));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -113,6 +113,10 @@ public class UserConstants
|
||||||
public final static String ORDER_CODE_UNIQUE = "0";
|
public final static String ORDER_CODE_UNIQUE = "0";
|
||||||
public final static String ORDER_CODE_NOT_UNIQUE = "1";
|
public final static String ORDER_CODE_NOT_UNIQUE = "1";
|
||||||
|
|
||||||
|
/** 财务单编码是否唯一的返回结果 */
|
||||||
|
public final static String FINANCIAL_CODE_UNIQUE = "0";
|
||||||
|
public final static String FINANCIAL_CODE_NOT_UNIQUE = "1";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 密码长度限制
|
* 密码长度限制
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.ghy.payment.mapper;
|
||||||
|
|
||||||
|
import com.ghy.payment.domain.FinancialDetail;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 财务细单(转派后产生的订单)的mapper层
|
||||||
|
*
|
||||||
|
* @author HH 2022/4/25
|
||||||
|
*/
|
||||||
|
public interface FinancialDetailMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialDetail 财务细单属性
|
||||||
|
* @return 成功条数
|
||||||
|
*/
|
||||||
|
int insertFinancialDetail(FinancialDetail financialDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialDetail 财务细单属性
|
||||||
|
* @return 成功条数
|
||||||
|
*/
|
||||||
|
int updateFinancialDetail(FinancialDetail financialDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialDetail 财务细单入参
|
||||||
|
* @return 财务细单集合
|
||||||
|
*/
|
||||||
|
List<FinancialDetail> selectFinancialDetailList(FinancialDetail financialDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialDetailId 财务细单id
|
||||||
|
* @return 财务细单
|
||||||
|
*/
|
||||||
|
FinancialDetail selectById(Long financialDetailId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除财务细单信息
|
||||||
|
*
|
||||||
|
* @param financialDetailIds 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteFinancialDetailByIds(Long[] financialDetailIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialDetailCode 财务细单编码
|
||||||
|
* @return 财务细单信息
|
||||||
|
*/
|
||||||
|
FinancialDetail checkFinancialDetailCodeUnique(String financialDetailCode);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.ghy.payment.mapper;
|
||||||
|
|
||||||
|
import com.ghy.payment.domain.FinancialMaster;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主财务单的mapper层
|
||||||
|
*
|
||||||
|
* @author HH 2022/4/24
|
||||||
|
*/
|
||||||
|
public interface FinancialMasterMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialMaster 主财务单属性
|
||||||
|
* @return 成功条数
|
||||||
|
*/
|
||||||
|
int insertFinancialMaster(FinancialMaster financialMaster);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialMaster 主财务单属性
|
||||||
|
* @return 成功条数
|
||||||
|
*/
|
||||||
|
int updateFinancialMaster(FinancialMaster financialMaster);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialMaster 主财务单入参
|
||||||
|
* @return 主财务单集合
|
||||||
|
*/
|
||||||
|
List<FinancialMaster> selectFinancialMasterList(FinancialMaster financialMaster);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialMasterId 主财务单id
|
||||||
|
* @return 主财务单
|
||||||
|
*/
|
||||||
|
FinancialMaster selectById(Long financialMasterId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除主财务单信息
|
||||||
|
*
|
||||||
|
* @param financialMasterIds 需要删除的数据ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteFinancialMasterByIds(Long[] financialMasterIds);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.ghy.payment.service;
|
||||||
|
|
||||||
|
import com.ghy.payment.domain.FinancialDetail;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 财务细单接口
|
||||||
|
*
|
||||||
|
* @author HH 2022/4/25
|
||||||
|
*/
|
||||||
|
public interface FinancialDetailService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialDetail 财务细单属性
|
||||||
|
* @return 成功条数
|
||||||
|
*/
|
||||||
|
int insertFinancialDetail(FinancialDetail financialDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialDetail 财务细单属性
|
||||||
|
* @return 成功条数
|
||||||
|
*/
|
||||||
|
int updateFinancialDetail(FinancialDetail financialDetail);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialDetail 财务细单入参
|
||||||
|
* @return 财务细单集合
|
||||||
|
*/
|
||||||
|
List<FinancialDetail> selectFinancialDetailList(FinancialDetail financialDetail);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialDetailId 财务细单id
|
||||||
|
* @return 财务细单
|
||||||
|
*/
|
||||||
|
FinancialDetail selectById(Long financialDetailId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ids 财务细单ids
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
int deleteFinancialDetailByIds(String ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验财务细单编码是否重复
|
||||||
|
*
|
||||||
|
* @param financialDetail 财务细单属性
|
||||||
|
* @return 校验结果 1存在 0不存在
|
||||||
|
*/
|
||||||
|
String checkFinancialDetailCodeUnique(FinancialDetail financialDetail);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.ghy.payment.service;
|
||||||
|
|
||||||
|
import com.ghy.payment.domain.FinancialMaster;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主财务单接口
|
||||||
|
*
|
||||||
|
* @author clunt
|
||||||
|
*/
|
||||||
|
public interface FinancialMasterService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialMaster 主财务单属性
|
||||||
|
* @return 成功条数
|
||||||
|
*/
|
||||||
|
int insertFinancialMaster(FinancialMaster financialMaster);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialMaster 主财务单属性
|
||||||
|
* @return 成功条数
|
||||||
|
*/
|
||||||
|
int updateFinancialMaster(FinancialMaster financialMaster);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialMaster 主财务单入参
|
||||||
|
* @return 主财务单集合
|
||||||
|
*/
|
||||||
|
List<FinancialMaster> selectFinancialMasterList(FinancialMaster financialMaster);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param financialMasterId 主财务单id
|
||||||
|
* @return 主财务单
|
||||||
|
*/
|
||||||
|
FinancialMaster selectById(Long financialMasterId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ids 主财务单ids
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
int deleteFinancialMasterByIds(String ids);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.ghy.payment.service.impl;
|
||||||
|
|
||||||
|
import com.ghy.common.constant.UserConstants;
|
||||||
|
import com.ghy.common.core.text.Convert;
|
||||||
|
import com.ghy.payment.domain.FinancialDetail;
|
||||||
|
import com.ghy.payment.mapper.FinancialDetailMapper;
|
||||||
|
import com.ghy.payment.service.FinancialDetailService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class FinancialDetailServiceImpl implements FinancialDetailService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private FinancialDetailMapper financialDetailMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertFinancialDetail(FinancialDetail financialDetail) {
|
||||||
|
return financialDetailMapper.insertFinancialDetail(financialDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateFinancialDetail(FinancialDetail financialDetail) {
|
||||||
|
return financialDetailMapper.updateFinancialDetail(financialDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FinancialDetail> selectFinancialDetailList(FinancialDetail financialDetail) {
|
||||||
|
return financialDetailMapper.selectFinancialDetailList(financialDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FinancialDetail selectById(Long financialDetailId) {
|
||||||
|
return financialDetailMapper.selectById(financialDetailId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteFinancialDetailByIds(String ids) {
|
||||||
|
Long[] financialDetailIds = Convert.toLongArray(ids);
|
||||||
|
return financialDetailMapper.deleteFinancialDetailByIds(financialDetailIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String checkFinancialDetailCodeUnique(FinancialDetail financialDetail) {
|
||||||
|
long financialDetailId = financialDetail.getId() == null ? -1L : financialDetail.getId();
|
||||||
|
FinancialDetail info = financialDetailMapper.checkFinancialDetailCodeUnique(financialDetail.getCode());
|
||||||
|
if (info != null && info.getId() != financialDetailId) {
|
||||||
|
return UserConstants.FINANCIAL_CODE_NOT_UNIQUE;
|
||||||
|
}
|
||||||
|
return UserConstants.FINANCIAL_CODE_UNIQUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.ghy.payment.service.impl;
|
||||||
|
|
||||||
|
import com.ghy.common.core.text.Convert;
|
||||||
|
import com.ghy.payment.domain.FinancialMaster;
|
||||||
|
import com.ghy.payment.mapper.FinancialMasterMapper;
|
||||||
|
import com.ghy.payment.service.FinancialMasterService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品模块实现类
|
||||||
|
*
|
||||||
|
* @author clunt
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class FinancialMasterServiceImpl implements FinancialMasterService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private FinancialMasterMapper financialMasterMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertFinancialMaster(FinancialMaster financialMaster) {
|
||||||
|
return financialMasterMapper.insertFinancialMaster(financialMaster);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateFinancialMaster(FinancialMaster financialMaster) {
|
||||||
|
return financialMasterMapper.updateFinancialMaster(financialMaster);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FinancialMaster> selectFinancialMasterList(FinancialMaster financialMaster) {
|
||||||
|
return financialMasterMapper.selectFinancialMasterList(financialMaster);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FinancialMaster selectById(Long financialMasterId) {
|
||||||
|
return financialMasterMapper.selectById(financialMasterId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteFinancialMasterByIds(String ids) {
|
||||||
|
Long[] financialMasterIds = Convert.toLongArray(ids);
|
||||||
|
return financialMasterMapper.deleteFinancialMasterByIds(financialMasterIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,137 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ghy.payment.mapper.FinancialDetailMapper">
|
||||||
|
|
||||||
|
<resultMap id="FinancialDetailResult" type="com.ghy.payment.domain.FinancialDetail">
|
||||||
|
<id property="id" column="id"/>
|
||||||
|
<result property="code" column="code"/>
|
||||||
|
<result property="orderMasterId" column="order_master_id"/>
|
||||||
|
<result property="orderMasterCode" column="order_master_code"/>
|
||||||
|
<result property="totalMoney" column="total_money"/>
|
||||||
|
<result property="discountMoney" column="discount_money"/>
|
||||||
|
<result property="payMoney" column="pay_money"/>
|
||||||
|
<result property="payType" column="pay_type"/>
|
||||||
|
<result property="payStatus" column="pay_status"/>
|
||||||
|
<result property="payTime" column="pay_time"/>
|
||||||
|
<result property="financialDetailType" column="financial_detail_type"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectFinancialDetail">
|
||||||
|
SELECT id,
|
||||||
|
code,
|
||||||
|
order_master_id,
|
||||||
|
order_master_code,
|
||||||
|
total_money,
|
||||||
|
discount_money,
|
||||||
|
pay_money,
|
||||||
|
pay_type,
|
||||||
|
pay_status,
|
||||||
|
pay_time,
|
||||||
|
financial_detail_type,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
remark
|
||||||
|
FROM financial_detail
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectFinancialDetailList" parameterType="com.ghy.payment.domain.FinancialDetail"
|
||||||
|
resultMap="FinancialDetailResult">
|
||||||
|
<include refid="selectFinancialDetail"/>
|
||||||
|
<where>
|
||||||
|
<if test="orderMasterId != null and orderMasterId != 0">
|
||||||
|
AND order_master_id = #{orderMasterId}
|
||||||
|
</if>
|
||||||
|
<if test="orderMasterCode != null and orderMasterCode != ''">
|
||||||
|
AND order_master_code LIKE concat('%', #{orderMasterCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="payType != null and payType != 0">
|
||||||
|
AND pay_type = #{payType}
|
||||||
|
</if>
|
||||||
|
<if test="payStatus != null and payStatus != 0">
|
||||||
|
AND pay_status = #{payStatus}
|
||||||
|
</if>
|
||||||
|
<if test="financialDetailType != null and financialDetailType != 0">
|
||||||
|
AND financial_detail_type = #{financialDetailType}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectById" parameterType="long" resultMap="FinancialDetailResult">
|
||||||
|
<include refid="selectFinancialDetail"/>
|
||||||
|
<where>
|
||||||
|
<if test="financialDetailId != null and financialDetailId != 0">
|
||||||
|
AND id = #{financialDetailId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="deleteFinancialDetailByIds" parameterType="Long">
|
||||||
|
DELETE FROM financial_detail WHERE id IN
|
||||||
|
<foreach collection="array" item="financialDetailId" open="(" separator="," close=")">
|
||||||
|
#{financialDetailId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<update id="updateFinancialDetail" parameterType="com.ghy.payment.domain.FinancialDetail">
|
||||||
|
UPDATE financial_detail
|
||||||
|
<set>
|
||||||
|
<if test="code != null and code != 0">code = #{code},</if>
|
||||||
|
<if test="orderMasterId != null and orderMasterId != ''">order_master_id = #{orderMasterId},</if>
|
||||||
|
<if test="orderMasterCode != null and orderMasterCode != ''">order_master_code = #{orderMasterCode},</if>
|
||||||
|
<if test="totalMoney != null and totalMoney != ''">total_money = #{totalMoney},</if>
|
||||||
|
<if test="discountMoney != null and discountMoney != ''">discount_money = #{discountMoney},</if>
|
||||||
|
<if test="payType != null and payType != ''">pay_type = #{payType},</if>
|
||||||
|
<if test="payStatus != null and payStatus != ''">pay_status = #{payStatus},</if>
|
||||||
|
<if test="payTime != null and payTime != ''">pay_time = #{payTime},</if>
|
||||||
|
<if test="payMoney != null and payMoney != ''">pay_money = #{payMoney},</if>
|
||||||
|
<if test="financialDetailType != null and financialDetailType != 0">financial_detail_type = #{financialDetailType},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
|
update_time = SYSDATE()
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<insert id="insertFinancialDetail" parameterType="com.ghy.payment.domain.FinancialDetail" useGeneratedKeys="true"
|
||||||
|
keyProperty="id">
|
||||||
|
INSERT INTO financial_detail(
|
||||||
|
<if test="code != null and code != 0">code,</if>
|
||||||
|
<if test="orderMasterId != null and orderMasterId != 0">order_master_id,</if>
|
||||||
|
<if test="orderMasterCode != null and orderMasterCode != ''">order_master_code,</if>
|
||||||
|
<if test="totalMoney != null and totalMoney != ''">total_money,</if>
|
||||||
|
<if test="discountMoney != null and discountMoney != ''">discount_money,</if>
|
||||||
|
<if test="payType != null and payType != ''">pay_type,</if>
|
||||||
|
<if test="payStatus != null and payStatus != ''">pay_status,</if>
|
||||||
|
<if test="payTime != null and payTime != ''">pay_time,</if>
|
||||||
|
<if test="payMoney != null and payMoney != ''">pay_money,</if>
|
||||||
|
<if test="financialDetailType != null and financialDetailType != ''">financial_detail_type,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
create_time
|
||||||
|
)VALUES(
|
||||||
|
<if test="code != null and code != 0">#{code},</if>
|
||||||
|
<if test="orderMasterId != null and orderMasterId != 0">#{orderMasterId},</if>
|
||||||
|
<if test="orderMasterCode != null and orderMasterCode != ''">#{orderMasterCode},</if>
|
||||||
|
<if test="totalMoney != null and totalMoney != ''">#{totalMoney},</if>
|
||||||
|
<if test="discountMoney != null and discountMoney != ''">#{discountMoney},</if>
|
||||||
|
<if test="payType != null and payType != ''">#{payType},</if>
|
||||||
|
<if test="payStatus != null and payStatus != ''">#{payStatus},</if>
|
||||||
|
<if test="payTime != null and payTime != ''">#{payTime},</if>
|
||||||
|
<if test="payMoney != null and payMoney != ''">#{payMoney},</if>
|
||||||
|
<if test="financialDetailType != null and financialDetailType != ''">#{financialDetailType},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
SYSDATE()
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="checkFinancialDetailCodeUnique" parameterType="String" resultMap="FinancialDetailResult">
|
||||||
|
<include refid="selectFinancialDetail"/>
|
||||||
|
WHERE `code` =#{financialDetailCode} LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,117 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ghy.payment.mapper.FinancialMasterMapper">
|
||||||
|
|
||||||
|
<resultMap id="FinancialMasterResult" type="com.ghy.payment.domain.FinancialMaster">
|
||||||
|
<id property="id" column="id"/>
|
||||||
|
<result property="orderMasterId" column="order_master_id"/>
|
||||||
|
<result property="orderMasterCode" column="order_master_code"/>
|
||||||
|
<result property="totalMoney" column="total_money"/>
|
||||||
|
<result property="discountMoney" column="discount_money"/>
|
||||||
|
<result property="payMoney" column="pay_money"/>
|
||||||
|
<result property="payType" column="pay_type"/>
|
||||||
|
<result property="payStatus" column="pay_status"/>
|
||||||
|
<result property="payTime" column="pay_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectFinancialMaster">
|
||||||
|
SELECT id,
|
||||||
|
order_master_id,
|
||||||
|
order_master_code,
|
||||||
|
total_money,
|
||||||
|
discount_money,
|
||||||
|
pay_money,
|
||||||
|
pay_type,
|
||||||
|
pay_status,
|
||||||
|
pay_time,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
remark
|
||||||
|
FROM financial_master
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectFinancialMasterList" parameterType="com.ghy.payment.domain.FinancialMaster" resultMap="FinancialMasterResult">
|
||||||
|
<include refid="selectFinancialMaster"/>
|
||||||
|
<where>
|
||||||
|
<if test="orderMasterId != null and orderMasterId != 0">
|
||||||
|
AND order_master_id = #{orderMasterId}
|
||||||
|
</if>
|
||||||
|
<if test="orderMasterCode != null and orderMasterCode != ''">
|
||||||
|
AND order_master_code LIKE concat('%', #{orderMasterCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="payType != null and payType != 0">
|
||||||
|
AND pay_type = #{payType}
|
||||||
|
</if>
|
||||||
|
<if test="payStatus != null and payStatus != 0">
|
||||||
|
AND pay_status = #{payStatus}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectById" parameterType="long" resultMap="FinancialMasterResult">
|
||||||
|
<include refid="selectFinancialMaster"/>
|
||||||
|
<where>
|
||||||
|
<if test="financialMasterId != null and financialMasterId != 0">
|
||||||
|
AND id = #{financialMasterId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="deleteFinancialMasterByIds" parameterType="Long">
|
||||||
|
DELETE FROM financial_master WHERE id IN
|
||||||
|
<foreach collection="array" item="financialMasterId" open="(" separator="," close=")">
|
||||||
|
#{financialMasterId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<update id="updateFinancialMaster" parameterType="com.ghy.payment.domain.FinancialMaster">
|
||||||
|
UPDATE financial_master
|
||||||
|
<set>
|
||||||
|
<if test="orderMasterId != null and orderMasterId != ''">order_master_id = #{orderMasterId},</if>
|
||||||
|
<if test="orderMasterCode != null and orderMasterCode != ''">order_master_code = #{orderMasterCode},</if>
|
||||||
|
<if test="totalMoney != null and totalMoney != ''">total_money = #{totalMoney},</if>
|
||||||
|
<if test="discountMoney != null and discountMoney != ''">discount_money = #{discountMoney},</if>
|
||||||
|
<if test="payType != null and payType != ''">pay_type = #{payType},</if>
|
||||||
|
<if test="payStatus != null and payStatus != ''">pay_status = #{payStatus},</if>
|
||||||
|
<if test="payTime != null and payTime != ''">pay_time = #{payTime},</if>
|
||||||
|
<if test="payMoney != null and payMoney != ''">pay_money = #{payMoney},</if>
|
||||||
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
|
update_time = SYSDATE()
|
||||||
|
</set>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<insert id="insertFinancialMaster" parameterType="com.ghy.payment.domain.FinancialMaster" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
INSERT INTO financial_master(
|
||||||
|
<if test="orderMasterId != null and orderMasterId != 0">order_master_id,</if>
|
||||||
|
<if test="orderMasterCode != null and orderMasterCode != ''">order_master_code,</if>
|
||||||
|
<if test="totalMoney != null and totalMoney != ''">total_money,</if>
|
||||||
|
<if test="discountMoney != null and discountMoney != ''">discount_money,</if>
|
||||||
|
<if test="payType != null and payType != ''">pay_type,</if>
|
||||||
|
<if test="payStatus != null and payStatus != ''">pay_status,</if>
|
||||||
|
<if test="payTime != null and payTime != ''">pay_time,</if>
|
||||||
|
<if test="payMoney != null and payMoney != ''">pay_money,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
create_time
|
||||||
|
)VALUES(
|
||||||
|
<if test="orderMasterId != null and orderMasterId != 0">#{orderMasterId},</if>
|
||||||
|
<if test="orderMasterCode != null and orderMasterCode != ''">#{orderMasterCode},</if>
|
||||||
|
<if test="totalMoney != null and totalMoney != ''">#{totalMoney},</if>
|
||||||
|
<if test="discountMoney != null and discountMoney != ''">#{discountMoney},</if>
|
||||||
|
<if test="payType != null and payType != ''">#{payType},</if>
|
||||||
|
<if test="payStatus != null and payStatus != ''">#{payStatus},</if>
|
||||||
|
<if test="payTime != null and payTime != ''">#{payTime},</if>
|
||||||
|
<if test="payMoney != null and payMoney != ''">#{payMoney},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
SYSDATE()
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
7
pom.xml
7
pom.xml
|
|
@ -282,6 +282,13 @@
|
||||||
<version>${ghy.version}</version>
|
<version>${ghy.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 财务模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ghy</groupId>
|
||||||
|
<artifactId>ghy-payment</artifactId>
|
||||||
|
<version>${ghy.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 通用工具-->
|
<!-- 通用工具-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ghy</groupId>
|
<groupId>com.ghy</groupId>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue