记得上下班打卡 | git大法好,push需谨慎

Commit 56982c11 authored by 胡佳晨's avatar 胡佳晨

Merge remote-tracking branch 'origin/jxl_1115_refund' into dev_merchant

# Conflicts:
#	liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/vo/mongo/KylinPerformanceVo.java
#	liquidnet-bus-do/liquidnet-service-kylin-do/src/main/java/com/liquidnet/service/kylin/entity/KylinPerformanceStatus.java
parents 45ee5049 5140346e
...@@ -68,4 +68,6 @@ public class KylinRedisConst { ...@@ -68,4 +68,6 @@ public class KylinRedisConst {
public static final String ADMIN_UPUSH_LIST_ANDROID = "basicServices:upushList:Android"; public static final String ADMIN_UPUSH_LIST_ANDROID = "basicServices:upushList:Android";
public static final String ADMIN_BANNER_LIST = "kylin:bannerList"; public static final String ADMIN_BANNER_LIST = "kylin:bannerList";
public static final String KYLIN_EXPRESS_MODULES = "kylin:express:modules";
} }
package com.liquidnet.service.kylin.dto.param.admin;
import com.liquidnet.service.kylin.entity.KylinExpressModule;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* <p>
* ExpressModuleFromParam
* </p>
*
* @author jiangxiulong
* @since 2021-11-15
*/
@Data
@ApiModel(value = "ExpressModuleFromParam", description = "快递模版创建、编辑入参")
public class ExpressModuleFromParam implements Serializable, Cloneable {
private static final long serialVersionUID = -5031042101093959654L;
@ApiModelProperty(value = "快递模版id[创建不传] 编辑必须要传", example = "429803743878963206506461")
private String moduleId;
@ApiModelProperty(value = "快件产品名称", example = "标快")
@NotBlank(message = "快件产品名称不能为空")
private String title;
@ApiModelProperty(value = "产品编码", example = "255")
@NotNull(message = "产品编码不能为空")
private Integer productCode;
@ApiModelProperty(value = "时效类型", example = "T4")
@NotBlank(message = "时效类型不能为空")
private String agingType;
@ApiModelProperty(value = "快递预估价格", example = "10")
@NotNull(message = "快递预估价格不能为空mim")
private BigDecimal estimatePriceMin;
@ApiModelProperty(value = "快递预估价格", example = "30")
@NotNull(message = "快递预估价格不能为空max")
private BigDecimal estimatePriceMax;
@ApiModelProperty(value = "是否上线 1未上线 2已上线", example = "429803743878963206506461")
@NotNull(message = "是否上线不能为空") @Min(value = 1, message = "isOnline无效") @Max(value = 2, message = "isOnline无效")
private Integer isOnline;
private static final ExpressModuleFromParam obj = new ExpressModuleFromParam();
public static ExpressModuleFromParam getNew() {
try {
return (ExpressModuleFromParam) obj.clone();
} catch (CloneNotSupportedException e) {
return new ExpressModuleFromParam();
}
}
public KylinExpressModule copy(ExpressModuleFromParam source) {
KylinExpressModule expressModule = KylinExpressModule.getNew();
if (null == source) return null;
expressModule.setTitle(source.getTitle());
expressModule.setProductCode(source.getProductCode());
expressModule.setAgingType(source.getAgingType());
expressModule.setEstimatePriceMin(source.getEstimatePriceMin());
expressModule.setEstimatePriceMax(source.getEstimatePriceMax());
expressModule.setIsOnline(source.getIsOnline());
return expressModule;
}
}
\ No newline at end of file
package com.liquidnet.service.kylin.dto.vo;
import com.liquidnet.service.kylin.entity.KylinExpressModule;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* <p>
* 快递模版vo
* </p>
*
* @author jiangxiulong
* @since 2021-11-15
*/
@Data
@ApiModel
public class KylinExpressModuleVo implements Serializable {
private static final long serialVersionUID = 2171590423135769848L;
@ApiModelProperty(value = "快递模版id")
private String moduleId;
@ApiModelProperty(value = "快件产品名称")
private String title;
@ApiModelProperty(value = "产品编码")
private Integer productCode;
@ApiModelProperty(value = "时效类型")
private String agingType;
@ApiModelProperty(value = "快递预估价格小")
private BigDecimal estimatePriceMin;
@ApiModelProperty(value = "快递预估价格大")
private BigDecimal estimatePriceMax;
@ApiModelProperty(value = "是否上线 1未上线 2已上线")
private Integer isOnline;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createdAt;
@ApiModelProperty(value = "更新时间")
private LocalDateTime updatedAt;
private static final KylinExpressModuleVo obj = new KylinExpressModuleVo();
public static KylinExpressModuleVo getNew() {
try {
return (KylinExpressModuleVo) obj.clone();
} catch (CloneNotSupportedException e) {
return new KylinExpressModuleVo();
}
}
public KylinExpressModuleVo copy(KylinExpressModule source) {
KylinExpressModuleVo expressModuleVo = KylinExpressModuleVo.getNew();
if (null == source) return null;
expressModuleVo.setModuleId(source.getModuleId());
expressModuleVo.setTitle(source.getTitle());
expressModuleVo.setProductCode(source.getProductCode());
expressModuleVo.setAgingType(source.getAgingType());
expressModuleVo.setEstimatePriceMin(source.getEstimatePriceMin());
expressModuleVo.setEstimatePriceMax(source.getEstimatePriceMax());
expressModuleVo.setIsOnline(source.getIsOnline());
expressModuleVo.setCreatedAt(source.getCreatedAt());
expressModuleVo.setUpdatedAt(source.getUpdatedAt());
return expressModuleVo;
}
}
...@@ -17,6 +17,7 @@ public class PerformanceRefundConfigVo { ...@@ -17,6 +17,7 @@ public class PerformanceRefundConfigVo {
private Integer isRefundPoundage; private Integer isRefundPoundage;
private Integer isRefundVoucher; private Integer isRefundVoucher;
private Integer isRefundExpress; private Integer isRefundExpress;
private Integer isBackPaperTicket;
private OrderRefundAddress orderRefundAddress; private OrderRefundAddress orderRefundAddress;
} }
...@@ -119,6 +119,7 @@ public class KylinPerformanceVo { ...@@ -119,6 +119,7 @@ public class KylinPerformanceVo {
private Integer isRefundPoundage; private Integer isRefundPoundage;
private Integer isRefundVoucher; private Integer isRefundVoucher;
private Integer isRefundExpress; private Integer isRefundExpress;
private Integer isBackPaperTicket;
private Integer auditStatus; private Integer auditStatus;
private String rejectTxt; private String rejectTxt;
...@@ -187,6 +188,7 @@ public class KylinPerformanceVo { ...@@ -187,6 +188,7 @@ public class KylinPerformanceVo {
this.isRefundVoucher = performanceStatus.getIsRefundVoucher(); this.isRefundVoucher = performanceStatus.getIsRefundVoucher();
this.isRefundExpress = performanceStatus.getIsRefundExpress(); this.isRefundExpress = performanceStatus.getIsRefundExpress();
this.auditStatus = 0; this.auditStatus = 0;
this.isBackPaperTicket = performanceStatus.getIsBackPaperTicket();
} }
public void setPerformanceRelations(KylinPerformanceRelations performanceRelations) { public void setPerformanceRelations(KylinPerformanceRelations performanceRelations) {
......
package com.liquidnet.service.kylin.service;
import com.liquidnet.service.kylin.dto.vo.KylinExpressModuleVo;
import java.util.List;
/**
* <p>
* 快递模板表 服务类
* </p>
*
* @author jiangxiulong
* @since 2021-11-15
*/
public interface IKylinExpressModuleService {
List<KylinExpressModuleVo> expressList();
}
...@@ -202,7 +202,9 @@ public interface IKylinPerformancesAdminService { ...@@ -202,7 +202,9 @@ public interface IKylinPerformancesAdminService {
String refundCloseTime, String refundCloseTime,
Integer isRefundPoundage, Integer isRefundPoundage,
Integer isRefundVoucher, Integer isRefundVoucher,
Integer isRefundExpress); Integer isRefundExpress,
Integer isBackPaperTicket
);
/** /**
* 获取 演出转赠配置 * 获取 演出转赠配置
......
package com.liquidnet.client.admin.web.controller.zhengzai.kylin;
import com.github.pagehelper.PageInfo;
import com.liquidnet.client.admin.common.annotation.Log;
import com.liquidnet.client.admin.common.core.controller.BaseController;
import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.common.enums.BusinessType;
import com.liquidnet.client.admin.zhengzai.kylin.service.IKylinExpressModuleService;
import com.liquidnet.service.kylin.dto.param.admin.ExpressModuleFromParam;
import com.liquidnet.service.kylin.entity.KylinExpressModule;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
/**
* <p>
* 快递模板表 前端控制器
* </p>
*
* @author jiangxiulong
* @since 2021-11-15
*/
@Validated
@Controller
@RequestMapping("/kylin/expressModule")
public class KylinExpressModuleController extends BaseController {
private String prefix = "zhengzai/kylin/expressModule";
@Autowired
private IKylinExpressModuleService expressModuleService;
@Log(title = "快递模版创建", businessType = BusinessType.INSERT)
@RequiresPermissions("kylin:expressModule:create")
@PostMapping("create")
@ResponseBody
public AjaxResult create(ExpressModuleFromParam param) {
Integer result = expressModuleService.createForm(param);
if (result > 0) {
return success("操作成功");
} else {
return error("操作失败");
}
}
@Log(title = "快递模版编辑", businessType = BusinessType.UPDATE)
@RequiresPermissions("kylin:expressModule:update")
@PostMapping("update")
@ResponseBody
public AjaxResult update(ExpressModuleFromParam param) {
Integer result = expressModuleService.updateForm(param);
if (result > 0) {
return success("操作成功");
} else {
return error("操作失败");
}
}
@Log(title = "快递模版上下线", businessType = BusinessType.UPDATE)
@RequiresPermissions("kylin:expressModule:isOnline")
@PutMapping("isOnline")
@ResponseBody
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "moduleId", value = "快递模版id"),
@ApiImplicitParam(type = "form", required = true, dataType = "Integer", name = "isOnline", value = "是否上线 1下线 2上线"),
})
public AjaxResult isOnline(
@RequestParam("moduleId") @NotEmpty(message = "moduleId不能为空") String moduleId,
@RequestParam("isOnline") @NotNull(message = "isOnline不能为空") @Min(value = 1, message = "isOnline无效") @Max(value = 2, message = "isOnline无效") Integer isOnline
) {
Integer result = expressModuleService.isOnline(moduleId, isOnline);
if (result > 0) {
return success("操作成功");
} else {
return error("操作失败");
}
}
@Log(title = "快递模版详情", businessType = BusinessType.DETAIL)
@GetMapping("details")
@ResponseBody
@ApiImplicitParams({
@ApiImplicitParam(type = "query", required = true, dataType = "String", name = "moduleId", value = "快递模版id"),
})
public AjaxResult details(@RequestParam("moduleId") String moduleId) {
KylinExpressModule result = expressModuleService.detail(moduleId);
return AjaxResult.success(result);
}
@Log(title = "快递模版列表数据", businessType = BusinessType.LIST)
@RequiresPermissions("kylin:expressModule:list")
@PostMapping("list")
@ResponseBody
public TableDataInfo list() {
PageInfo<KylinExpressModule> result = expressModuleService.expressList();
return getDataTable(result.getList());
}
@GetMapping()
public String listView() {
return prefix + "/listView";
}
@GetMapping("/create")
public String createView() {
return prefix + "/create";
}
@GetMapping("/update/{moduleId}")
public String updateView(@PathVariable("moduleId") String moduleId, ModelMap mmap) {
KylinExpressModule result = expressModuleService.detail(moduleId);
mmap.put("KylinExpressModule", result);
return prefix + "/update";
}
}
...@@ -208,8 +208,10 @@ public class KylinPerformancesController extends BaseController { ...@@ -208,8 +208,10 @@ public class KylinPerformancesController extends BaseController {
@RequestParam("refundCloseTime") String refundCloseTime, @RequestParam("refundCloseTime") String refundCloseTime,
@RequestParam("isRefundPoundage") Integer isRefundPoundage, @RequestParam("isRefundPoundage") Integer isRefundPoundage,
@RequestParam("isRefundVoucher") Integer isRefundVoucher, @RequestParam("isRefundVoucher") Integer isRefundVoucher,
@RequestParam("isRefundExpress") Integer isRefundExpress) { @RequestParam("isRefundExpress") Integer isRefundExpress,
String result = kylinPerformancesService.changeRefundConfig(performancesId, isCanRefund, refundOpenTime, refundCloseTime, isRefundPoundage, isRefundVoucher, isRefundExpress); @RequestParam("isBackPaperTicket") Integer isBackPaperTicket
) {
String result = kylinPerformancesService.changeRefundConfig(performancesId, isCanRefund, refundOpenTime, refundCloseTime, isRefundPoundage, isRefundVoucher, isRefundExpress, isBackPaperTicket);
return this.success(result); return this.success(result);
} }
......
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('添加快递模版')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-post-add">
<div class="form-group">
<label class="col-sm-2 control-label is-required">快件产品名称:</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="title" id="title" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">产品编码:</label>
<div class="col-sm-10">
<input class="form-control" type="number" name="productCode" id="productCode">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">时效类型:</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="agingType" id="agingType" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">快递预估价格小:</label>
<div class="col-sm-10">
<input class="form-control" type="number" name="estimatePriceMin" id="estimatePriceMin">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">快递预估价格大:</label>
<div class="col-sm-10">
<input class="form-control" type="number" name="estimatePriceMax" id="estimatePriceMax">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">是否上线</label>
<div class="col-sm-10">
<div class="radio check-box">
<label>
<input type="radio" value="1" name="isOnline" checked=""> <i></i> 未上线
</label>
</div>
<div class="radio check-box">
<label>
<input type="radio" value="2" name="isOnline"> <i></i> 已上线
</label>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer"/>
<script type="text/javascript">
var prefix = ctx + "kylin/expressModule";
function submitHandler() {
if ($.validate.form()) {
var data = $('#form-post-add').serializeArray();
$.operate.save(prefix + "/create", data);
}
}
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('快递模版列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="kylin:expressModule:create">
<i class="fa fa-plus"></i> 添加
</a>
</div>
<div class="col-sm-12 select-table table-bordered">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
var updateFlag = [[${@permission.hasPermi('kylin:expressModule:create')}]];
var isOnlineFlag = [[${@permission.hasPermi('kylin:expressModule:isOnline')}]];
var prefix = ctx + "kylin/expressModule";
$(function () {
var options = {
url: prefix + "/list",
updateUrl: prefix + "/update/{id}",
createUrl: prefix + "/create",
modalName: "快递模版",
columns: [{
checkbox: true
},
{
field: 'title',
title: '快件产品名称'
},
{
field: 'productCode',
title: '产品编码'
},
{
field: 'agingType',
title: '时效类型'
},
{
field: '',
title: '快递预估价',
formatter: function (value, row, index) {
return row.estimatePriceMin + ' ~ ' + row.estimatePriceMax;
}
},
{
field: 'isOnline',
title: '状态',
formatter: function (value, row) {
var isOnline = row.isOnline;
if (row.isOnline == 1) {
isOnline = "未上线";
} else {
isOnline = "已上线";
}
return isOnline;
}
},
{
field: 'createdAt',
title: '创建时间'
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + updateFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.moduleId + '\')"></i>编辑</a> ');
actions.push(`<a class="btn btn-danger btn-xs ${isOnlineFlag}" href="javascript:void(0)" onclick="openModal('${row.moduleId}','${row.isOnline}')"></i>上下线</a> `);
return actions.join('');
}
}]
};
$.table.init(options);
});
function openModal(id, data) {
let title = '';
let lineId = null;
if (data == 1) {
title = '上线';
lineId = 2
} else {
title = '下线';
lineId = 1
}
$.modal.confirm(`确定要${title}此活动吗`, function() {
$.ajax({
type: 'put',
url: '/kylin/expressModule/isOnline',
data: {moduleId: id, isOnline: lineId},
success:function(e) {
$("button[name=refresh]").click();
}
})
});
}
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('编辑快递模版')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-post-add">
<div class="form-group">
<label class="col-sm-2 control-label is-required">快件产品名称:</label>
<div class="col-sm-10">
<input th:value="${KylinExpressModule.title}" class="form-control" type="text" name="title"
id="title" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">快件产品名称:</label>
<div class="col-sm-10">
<input th:value="${KylinExpressModule.productCode}" class="form-control" type="number" name="productCode"
id="productCode" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">时效类型:</label>
<div class="col-sm-10">
<input th:value="${KylinExpressModule.agingType}" class="form-control" type="text" name="agingType"
id="agingType" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">快递预估价格小:</label>
<div class="col-sm-10">
<input th:value="${KylinExpressModule.estimatePriceMin}" class="form-control" type="number" name="estimatePriceMin"
id="estimatePriceMin" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label is-required">快递预估价格大:</label>
<div class="col-sm-10">
<input th:value="${KylinExpressModule.estimatePriceMax}" class="form-control" type="number" name="estimatePriceMax"
id="estimatePriceMax" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">是否上线</label>
<div class="col-sm-10">
<div class="radio check-box">
<label>
<input type="radio" value="1" name="isOnline"
th:checked="${KylinExpressModule.isOnline==1 ? true : false}"> <i></i> 未上线
</label>
</div>
<div class="radio check-box">
<label>
<input type="radio" value="2" name="isOnline"
th:checked="${KylinExpressModule.isOnline==2 ? true : false}"> <i></i> 已上线
</label>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer"/>
<script type="text/javascript">
var prefix = ctx + "kylin/expressModule";
var moduleId = "[[${KylinExpressModule.moduleId}]]";
function submitHandler() {
if ($.validate.form()) {
var data = $('#form-post-add').serializeArray();
data.push({"name": "moduleId", "value": moduleId});
$.operate.save(prefix + "/update", data);
}
}
</script>
</body>
</html>
\ No newline at end of file
...@@ -95,6 +95,17 @@ ...@@ -95,6 +95,17 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">快递票是否需要退回:</label>
<div class="col-sm-8">
<div class="radio check-box">
<input type="radio" value="0" name="isBackPaperTicket" th:checked="*{isBackPaperTicket==0 ? true : false}" checked> 不需要</label>
</div>
<div class="radio check-box">
<input type="radio" value="1" name="isBackPaperTicket" th:checked="*{isBackPaperTicket==1 ? true : false}">需要</label>
</div>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">收货人:</label> <label class="col-sm-3 control-label">收货人:</label>
<div class="col-sm-8"> <div class="col-sm-8">
...@@ -156,7 +167,8 @@ ...@@ -156,7 +167,8 @@
refundCloseTime: $("input[name^='refundCloseTime']").val(), refundCloseTime: $("input[name^='refundCloseTime']").val(),
isRefundPoundage: parseInt($("input[name^='performance_isRefundPoundage']:checked").val()), isRefundPoundage: parseInt($("input[name^='performance_isRefundPoundage']:checked").val()),
isRefundVoucher: parseInt($("input[name^='performance_isRefundVoucher']:checked").val()), isRefundVoucher: parseInt($("input[name^='performance_isRefundVoucher']:checked").val()),
isRefundExpress: parseInt($("input[name^='performance_isRefundExpress']:checked").val()) isRefundExpress: parseInt($("input[name^='performance_isRefundExpress']:checked").val()),
isBackPaperTicket: parseInt($("input[name^='isBackPaperTicket']:checked").val())
} }
if ($("input[name^='refundCloseTime']").val() == "" || $("input[name^='refundOpenTime']").val() == "") { if ($("input[name^='refundCloseTime']").val() == "" || $("input[name^='refundOpenTime']").val() == "") {
......
package com.liquidnet.client.admin.zhengzai.kylin.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.liquidnet.service.kylin.dto.param.admin.ExpressModuleFromParam;
import com.liquidnet.service.kylin.entity.KylinExpressModule;
/**
* <p>
* 快递模板表 服务类
* </p>
*
* @author jiangxiulong
* @since 2021-11-15
*/
public interface IKylinExpressModuleService extends IService<KylinExpressModule> {
Integer createForm(ExpressModuleFromParam param);
Integer updateForm(ExpressModuleFromParam param);
Integer isOnline(String moduleId, Integer isOnline);
KylinExpressModule detail(String moduleId);
PageInfo<KylinExpressModule> expressList();
}
package com.liquidnet.client.admin.zhengzai.kylin.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageInfo;
import com.liquidnet.client.admin.zhengzai.kylin.service.IKylinExpressModuleService;
import com.liquidnet.client.admin.zhengzai.kylin.utils.DataUtils;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.kylin.dto.param.admin.ExpressModuleFromParam;
import com.liquidnet.service.kylin.dto.vo.KylinExpressModuleVo;
import com.liquidnet.service.kylin.entity.KylinExpressModule;
import com.liquidnet.service.kylin.mapper.KylinExpressModuleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* 快递模板表 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-11-15
*/
@Service
public class KylinExpressModuleServiceImpl extends ServiceImpl<KylinExpressModuleMapper, KylinExpressModule> implements IKylinExpressModuleService {
@Autowired
private KylinExpressModuleMapper moduleMapper;
@Autowired
private DataUtils dataUtils;
@Override
public Integer createForm(ExpressModuleFromParam param) {
try {
KylinExpressModule expressModule = ExpressModuleFromParam.getNew().copy(param);
String moduleId = IDGenerator.nextSnowId();
expressModule.setModuleId(moduleId);
int insert = moduleMapper.insert(expressModule);
// redis处理
this.expressModuleList();
return insert;
} catch (Exception e) {
log.error("创建失败 [e:{}]", e);
return 0;
}
}
@Override
public Integer updateForm(ExpressModuleFromParam param) {
try {
KylinExpressModule expressModule = ExpressModuleFromParam.getNew().copy(param);
expressModule.setUpdatedAt(LocalDateTime.now());
String moduleId = param.getModuleId();
int update = moduleMapper.update(
expressModule,
Wrappers.lambdaUpdate(KylinExpressModule.class).eq(KylinExpressModule::getModuleId, moduleId)
);
// redis处理
this.expressModuleList();
return update;
} catch (Exception e) {
log.error("编辑失败 [e:{}]", e);
return 0;
}
}
@Override
public Integer isOnline(String moduleId, Integer isOnline) {
KylinExpressModule expressModule = KylinExpressModule.getNew();
expressModule.setIsOnline(isOnline);
expressModule.setUpdatedAt(LocalDateTime.now());
int update = moduleMapper.update(
expressModule,
Wrappers.lambdaUpdate(KylinExpressModule.class).eq(KylinExpressModule::getModuleId, moduleId)
);
// redis处理
this.expressModuleList();
return update;
}
@Override
public KylinExpressModule detail(String getModuleId) {
KylinExpressModule expressModule = moduleMapper.selectOne(
Wrappers.lambdaQuery(KylinExpressModule.class).eq(KylinExpressModule::getModuleId, getModuleId)
);
return expressModule;
}
@Override
public PageInfo<KylinExpressModule> expressList() {
List<KylinExpressModule> kylinExpressModules = moduleMapper.selectList(Wrappers.lambdaQuery());
return new PageInfo(kylinExpressModules);
}
private void expressModuleList() {
// 列表
List<KylinExpressModule> kylinExpressModules = moduleMapper.selectList(
Wrappers.lambdaQuery(KylinExpressModule.class).eq(KylinExpressModule::getIsOnline, 2)
);
List<KylinExpressModuleVo> voList = new ArrayList<>();
kylinExpressModules.forEach(r -> {
KylinExpressModuleVo copy = KylinExpressModuleVo.getNew().copy(r);
voList.add(copy);
});
dataUtils.setkylinExpressModules(voList);
}
}
...@@ -614,6 +614,7 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma ...@@ -614,6 +614,7 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
vo.setIsRefundPoundage(kylinPerformanceStatus.getIsRefundPoundage()); vo.setIsRefundPoundage(kylinPerformanceStatus.getIsRefundPoundage());
vo.setIsRefundVoucher(kylinPerformanceStatus.getIsRefundVoucher()); vo.setIsRefundVoucher(kylinPerformanceStatus.getIsRefundVoucher());
vo.setIsRefundExpress(kylinPerformanceStatus.getIsRefundExpress()); vo.setIsRefundExpress(kylinPerformanceStatus.getIsRefundExpress());
vo.setIsBackPaperTicket(kylinPerformanceStatus.getIsBackPaperTicket());
vo.setOrderRefundAddress(dataUtils.getRefundAddress()); vo.setOrderRefundAddress(dataUtils.getRefundAddress());
return vo; return vo;
...@@ -674,7 +675,9 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma ...@@ -674,7 +675,9 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
String refundCloseTime, String refundCloseTime,
Integer isRefundPoundage, Integer isRefundPoundage,
Integer isRefundVoucher, Integer isRefundVoucher,
Integer isRefundExpress) { Integer isRefundExpress,
Integer isBackPaperTicket
) {
KylinPerformanceStatus kylinPerformanceStatusData = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId)); KylinPerformanceStatus kylinPerformanceStatusData = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId));
if (kylinPerformanceStatusData.getIsTransfer().equals(1) && isCanRefund.equals(1)) { if (kylinPerformanceStatusData.getIsTransfer().equals(1) && isCanRefund.equals(1)) {
return "修改失败,演出已开启转赠"; return "修改失败,演出已开启转赠";
...@@ -687,6 +690,7 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma ...@@ -687,6 +690,7 @@ public class KylinPerformancesAdminServiceImpl extends ServiceImpl<KylinPerforma
kylinPerformanceStatus.setIsRefundPoundage(isRefundPoundage); kylinPerformanceStatus.setIsRefundPoundage(isRefundPoundage);
kylinPerformanceStatus.setIsRefundVoucher(isRefundVoucher); kylinPerformanceStatus.setIsRefundVoucher(isRefundVoucher);
kylinPerformanceStatus.setIsRefundExpress(isRefundExpress); kylinPerformanceStatus.setIsRefundExpress(isRefundExpress);
kylinPerformanceStatus.setIsBackPaperTicket(isBackPaperTicket);
try { try {
performanceStatusMapper.update(kylinPerformanceStatus, new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId)); performanceStatusMapper.update(kylinPerformanceStatus, new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId));
......
package com.liquidnet.client.admin.zhengzai.kylin.utils; package com.liquidnet.client.admin.zhengzai.kylin.utils;
import com.liquidnet.service.kylin.dto.vo.KylinExpressModuleVo;
import com.liquidnet.service.kylin.dto.vo.admin.OrderRefundAddress; import com.liquidnet.service.kylin.dto.vo.admin.OrderRefundAddress;
import com.liquidnet.service.kylin.dto.vo.admin.OrderRefundPoundage; import com.liquidnet.service.kylin.dto.vo.admin.OrderRefundPoundage;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
...@@ -442,4 +443,9 @@ public class DataUtils { ...@@ -442,4 +443,9 @@ public class DataUtils {
return (PageInfo<OrderOutLineVo>) obj; return (PageInfo<OrderOutLineVo>) obj;
} }
} }
public void setkylinExpressModules(List<KylinExpressModuleVo> voList) {
String redisKey = KylinRedisConst.KYLIN_EXPRESS_MODULES;
redisUtil.set(redisKey, voList);
}
} }
package com.liquidnet.service.kylin.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 快递模板表
* </p>
*
* @author jiangxiulong
* @since 2021-11-15
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class KylinExpressModule implements Serializable {
private static final long serialVersionUID = -5081186584071376123L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* module_id
*/
private String moduleId;
/**
* 快件产品名称
*/
private String title;
/**
* 产品编码
*/
private Integer productCode;
/**
* 时效类型
*/
private String agingType;
/**
* 快递价格(预估)
*/
private BigDecimal estimatePriceMin;
/**
* 快递价格(预估)
*/
private BigDecimal estimatePriceMax;
/**
* 是否上线 1未上线 2已上线
*/
private Integer isOnline;
/**
* 创建时间
*/
private LocalDateTime createdAt;
/**
* 更新时间
*/
private LocalDateTime updatedAt;
private static final KylinExpressModule obj = new KylinExpressModule();
public static KylinExpressModule getNew() {
try {
return (KylinExpressModule) obj.clone();
} catch (CloneNotSupportedException e) {
return new KylinExpressModule();
}
}
}
...@@ -144,6 +144,11 @@ public class KylinPerformanceStatus implements Serializable ,Cloneable{ ...@@ -144,6 +144,11 @@ public class KylinPerformanceStatus implements Serializable ,Cloneable{
*/ */
private Integer fieldAuditStatus; private Integer fieldAuditStatus;
/**
* 快递票是否需要退回
*/
private Integer isBackPaperTicket;
/** /**
* 创建时间 * 创建时间
*/ */
......
package com.liquidnet.service.kylin.mapper;
import com.liquidnet.service.kylin.entity.KylinExpressModule;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 快递模板表 Mapper 接口
* </p>
*
* @author jiangxiulong
* @since 2021-11-15
*/
public interface KylinExpressModuleMapper extends BaseMapper<KylinExpressModule> {
}
<?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.liquidnet.service.kylin.mapper.KylinExpressModuleMapper">
</mapper>
-- 快递模板表
drop TABLE if exists `kylin_express_module`;
CREATE TABLE `kylin_express_module`
(
`mid` bigint unsigned NOT NULL AUTO_INCREMENT,
`module_id` varchar(255) NOT NULL DEFAULT '' COMMENT 'module_id',
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '快件产品名称',
`product_code` smallint NOT NULL DEFAULT 0 COMMENT '产品编码',
`aging_type` varchar(255) NOT NULL DEFAULT '' COMMENT '时效类型',
`estimate_price_min` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '快递价格(预估)',
`estimate_price_max` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '快递价格(预估)',
`is_online` tinyint NOT NULL DEFAULT 0 COMMENT '是否上线 1未上线 2已上线',
`created_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`mid`),
KEY `idx_kylin_module_id` (`module_id`)
) ENGINE = InnoDB
DEFAULT CHARSET utf8mb4
COLLATE utf8mb4_unicode_ci
ROW_FORMAT = DYNAMIC COMMENT '快递模板表';
alter table kylin_performance_status add is_back_paper_ticket tinyint NOT NULL DEFAULT 0 COMMENT '快递票是否需要退回 0不需要 1需要' after is_refund_express;
\ No newline at end of file
package com.liquidnet.service.kylin.controller;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dto.vo.KylinExpressModuleVo;
import com.liquidnet.service.kylin.service.IKylinExpressModuleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* 快递模板表 前端控制器
* </p>
*
* @author jiangxiulong
* @since 2021-11-15
*/
@Api(tags = "快递模板")
@RestController
@RequestMapping("expressModule")
@Slf4j
public class KylinExpressModuleController {
@Autowired
private IKylinExpressModuleService expressModuleService;
@GetMapping("")
@ApiOperation("快递模板列表")
public ResponseDto<List<KylinExpressModuleVo>> expressList() {
try {
List<KylinExpressModuleVo> result = expressModuleService.expressList();
return ResponseDto.success(result);
} catch (Exception e) {
log.error("快递模板列表Error e{}", e);
return ResponseDto.success(new ArrayList<>());
}
}
}
package com.liquidnet.service.kylin.service.impl;
import com.liquidnet.common.cache.redis.util.RedisUtil;
import com.liquidnet.service.kylin.constant.KylinRedisConst;
import com.liquidnet.service.kylin.dto.vo.KylinExpressModuleVo;
import com.liquidnet.service.kylin.entity.KylinExpressModule;
import com.liquidnet.service.kylin.mapper.KylinExpressModuleMapper;
import com.liquidnet.service.kylin.service.IKylinExpressModuleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 快递模板表 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-11-15
*/
@Service
public class KylinExpressModuleServiceImpl implements IKylinExpressModuleService {
@Autowired
private RedisUtil redisUtil;
@Override
public List<KylinExpressModuleVo> expressList() {
String redisKey = KylinRedisConst.KYLIN_EXPRESS_MODULES;
Object obj = redisUtil.get(redisKey);
if (null == obj) {
return null;
} else {
return (List<KylinExpressModuleVo>) obj;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment