新增复制订单
This commit is contained in:
parent
5cc8a96592
commit
ccdc8afaab
|
|
@ -123,6 +123,7 @@ public class DeptDataPermissionRule implements DataPermissionRule {
|
|||
return new EqualsTo(null, null); // WHERE null = null,可以保证返回的数据为空
|
||||
}
|
||||
|
||||
if(true) return null;
|
||||
// 情况三,拼接 Dept 和 User 的条件,最后组合
|
||||
Expression deptExpression = buildDeptExpression(tableName,tableAlias, deptDataPermission.getDeptIds());
|
||||
Expression userExpression = buildUserExpression(tableName, tableAlias, deptDataPermission.getSelf(), loginUser.getId());
|
||||
|
|
|
|||
|
|
@ -102,6 +102,10 @@
|
|||
<artifactId>x-easypdf</artifactId>
|
||||
<version>3.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hangtag</groupId>
|
||||
<artifactId>hangtag-spring-boot-starter-protection</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package cn.hangtag.module.oms.controller.admin.saleorder.front;
|
||||
|
||||
import cn.hangtag.framework.common.pojo.CommonResult;
|
||||
import cn.hangtag.framework.idempotent.core.annotation.Idempotent;
|
||||
import cn.hangtag.module.oms.controller.admin.saleorder.front.dto.CreateSaleOrderDTO;
|
||||
import cn.hangtag.module.oms.service.customer.CustomerService;
|
||||
import cn.hangtag.module.oms.service.saleorder.SaleOrderService;
|
||||
|
|
@ -13,6 +14,8 @@ import org.springframework.web.bind.annotation.*;
|
|||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static cn.hangtag.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "销售订单")
|
||||
|
|
@ -31,6 +34,7 @@ public class SaleOrderFrontController {
|
|||
|
||||
@PostMapping("/placeOrder")
|
||||
@Operation(summary = "下单")
|
||||
@Idempotent(timeout = 10, timeUnit = TimeUnit.SECONDS, message = "正在创建订单中,请勿重复提交")
|
||||
public CommonResult<Long> placeOrder(@Valid @RequestBody CreateSaleOrderDTO dto) {
|
||||
return success(saleOrderService.placeOrder(dto));
|
||||
}
|
||||
|
|
@ -40,10 +44,10 @@ public class SaleOrderFrontController {
|
|||
return success(saleOrderService.editOrder(id,dto));
|
||||
}
|
||||
|
||||
@GetMapping("/details/{id}")
|
||||
@GetMapping("/details/{type}/{id}")
|
||||
@Operation(summary = "编辑订单")
|
||||
public CommonResult<CreateSaleOrderDTO> placeOrder(@PathVariable Long id) {
|
||||
CreateSaleOrderDTO dto = saleOrderService.queryEditOrder(id);
|
||||
public CommonResult<CreateSaleOrderDTO> placeOrder(@PathVariable String type,@PathVariable Long id) {
|
||||
CreateSaleOrderDTO dto = saleOrderService.queryEditOrder(id,type);
|
||||
return success(dto);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ public interface SaleOrderService {
|
|||
* @param id ID
|
||||
* @return {@link CreateSaleOrderDTO }
|
||||
*/
|
||||
CreateSaleOrderDTO queryEditOrder(Long id);
|
||||
CreateSaleOrderDTO queryEditOrder(Long id,String type);
|
||||
|
||||
/**
|
||||
* 查询上次订单品牌
|
||||
|
|
|
|||
|
|
@ -765,7 +765,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
CustomerDO customerDO = customerMapper.selectById(customerId);
|
||||
String orderFollowerUser = order.getOrderFollowerUser();
|
||||
if (StringUtils.isNotBlank(orderFollowerUser) && customerDO!=null) {
|
||||
AdminUserDO user = adminUserService.getUser(Long.valueOf("143"));
|
||||
AdminUserDO user = adminUserService.getUser(Long.valueOf(orderFollowerUser));
|
||||
String email = user.getEmail();
|
||||
MailSendMessage message = new MailSendMessage();
|
||||
message.setAccountId(1L);
|
||||
|
|
@ -784,7 +784,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long editOrder(Long id, CreateSaleOrderDTO dto) {
|
||||
|
||||
SaleOrderDO saleOrderDO = checkEditOrder(id);
|
||||
SaleOrderDO saleOrderDO = checkEditOrder(id,null);
|
||||
// 校验订单
|
||||
SaleOrderDO order = new SaleOrderDO(dto);
|
||||
order.setId(saleOrderDO.getId());
|
||||
|
|
@ -1137,9 +1137,9 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CreateSaleOrderDTO queryEditOrder(Long id) {
|
||||
public CreateSaleOrderDTO queryEditOrder(Long id,String type) {
|
||||
CreateSaleOrderDTO res = new CreateSaleOrderDTO();
|
||||
SaleOrderDO saleOrderDO = checkEditOrder(id);
|
||||
SaleOrderDO saleOrderDO = checkEditOrder(id,type);
|
||||
BeanUtil.copyProperties(saleOrderDO, res);
|
||||
LambdaQueryWrapper<SaleOrderEntryDO> entryQueryWrapper = new LambdaQueryWrapper<>();
|
||||
entryQueryWrapper.eq(SaleOrderEntryDO::getParentId, saleOrderDO.getId());
|
||||
|
|
@ -1345,7 +1345,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
}
|
||||
}
|
||||
|
||||
private SaleOrderDO checkEditOrder(Long id) {
|
||||
private SaleOrderDO checkEditOrder(Long id,String type) {
|
||||
SaleOrderDO saleOrderDO = saleOrderMapper.selectById(id);
|
||||
AssertUtil.isEmpty(saleOrderDO, "订单不存在");
|
||||
String billStatus = saleOrderDO.getBillStatus();
|
||||
|
|
@ -1353,7 +1353,9 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
boolean order1 = BillStatusEnum.isCanEditOrder(billStatus);
|
||||
BillStatusEnum byValue = BillStatusEnum.getByValue(billStatus);
|
||||
AssertUtil.isEmpty(byValue, "订单状态异常");
|
||||
AssertUtil.isTrue(!order1, byValue.getName() + "状态不允许修改");
|
||||
if(!StringUtils.isNotBlank(type)){
|
||||
AssertUtil.isTrue(!order1, byValue.getName() + "状态不允许修改");
|
||||
}
|
||||
return saleOrderDO;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,8 +120,8 @@ export const SaleOrderApi = {
|
|||
return await request.post({ url: `/front/oms/sale-order/placeOrder`, data })
|
||||
},
|
||||
// 查询编辑订单
|
||||
queryEditById: async (id: string) => {
|
||||
return await request.get({ url: `/front/oms/sale-order/details/${id}` })
|
||||
queryEditById: async (id: string,type: string) => {
|
||||
return await request.get({ url: `/front/oms/sale-order/details/${type}/${id}` })
|
||||
},
|
||||
// 修改订单
|
||||
editOrder: async (id: string,data: any) => {
|
||||
|
|
|
|||
|
|
@ -826,7 +826,7 @@ onMounted(async () => {
|
|||
}
|
||||
// 获取订单信息
|
||||
if (queryParams.id) {
|
||||
const res = await SaleOrderApi.queryEditById(queryParams.id);
|
||||
const res = await SaleOrderApi.queryEditById(queryParams.id,queryParams.type);
|
||||
formData.value = res
|
||||
formData.value.bizdate = formatDate(new Date(res.bizdate), 'YYYY-MM-DD hh:mm:ss');
|
||||
that.tmpFormData.planDate = formatDate(new Date(res.plansenddate), 'YYYY-MM-DD');
|
||||
|
|
|
|||
Loading…
Reference in New Issue