Browse Source

Merge remote-tracking branch 'origin/dev' into dev

lazhaoqian 3 years ago
parent
commit
e5bcd71775
20 changed files with 616 additions and 24 deletions
  1. 34 0
      blade-service-api/blade-client-api/src/main/java/org/springblade/client/dto/BasicCorpsProfitChangeDTO.java
  2. 116 0
      blade-service-api/blade-client-api/src/main/java/org/springblade/client/entity/BasicCorpsProfitChange.java
  3. 8 0
      blade-service-api/blade-client-api/src/main/java/org/springblade/client/entity/CorpsDesc.java
  4. 9 0
      blade-service-api/blade-client-api/src/main/java/org/springblade/client/feign/ICorpsDescClient.java
  5. 31 0
      blade-service-api/blade-client-api/src/main/java/org/springblade/client/feign/ICorpsProfitChangeClient.java
  6. 37 0
      blade-service-api/blade-client-api/src/main/java/org/springblade/client/vo/BasicCorpsProfitChangeVO.java
  7. 4 0
      blade-service-api/blade-purchase-sales-api/src/main/java/org/springblade/purchase/sales/entity/Order.java
  8. 2 0
      blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/vojo/Acc.java
  9. 1 1
      blade-service/blade-check/src/main/java/org/springblade/check/service/impl/AuditProecessServiceImpl.java
  10. 116 0
      blade-service/blade-client/src/main/java/org/springblade/client/corps/controller/BasicCorpsProfitChangeController.java
  11. 8 0
      blade-service/blade-client/src/main/java/org/springblade/client/corps/feign/CorpsDescClient.java
  12. 45 0
      blade-service/blade-client/src/main/java/org/springblade/client/corps/mapper/BasicCorpsProfitChangeMapper.java
  13. 7 0
      blade-service/blade-client/src/main/java/org/springblade/client/corps/mapper/BasicCorpsProfitChangeMapper.xml
  14. 33 0
      blade-service/blade-client/src/main/java/org/springblade/client/corps/service/IBasicCorpsProfitChangeService.java
  15. 38 0
      blade-service/blade-client/src/main/java/org/springblade/client/corps/service/impl/BasicCorpsProfitChangeServiceImpl.java
  16. 1 0
      blade-service/blade-client/src/main/java/org/springblade/client/message/controller/MessageController.java
  17. 41 17
      blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/service/impl/DeliveryServiceImpl.java
  18. 1 1
      blade-service/blade-project/src/main/java/org/springblade/project/service/impl/ServiceProjectServiceImpl.java
  19. 80 5
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/impl/OrderServiceImpl.java
  20. 4 0
      blade-service/trade-finance/src/main/java/org/springblade/finance/controller/AccController.java

+ 34 - 0
blade-service-api/blade-client-api/src/main/java/org/springblade/client/dto/BasicCorpsProfitChangeDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.client.dto;
+
+import org.springblade.client.entity.BasicCorpsProfitChange;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2022-01-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class BasicCorpsProfitChangeDTO extends BasicCorpsProfitChange {
+	private static final long serialVersionUID = 1L;
+
+}

+ 116 - 0
blade-service-api/blade-client-api/src/main/java/org/springblade/client/entity/BasicCorpsProfitChange.java

@@ -0,0 +1,116 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.client.entity;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2022-01-14
+ */
+@Data
+@ApiModel(value = "BasicCorpsProfitChange对象", description = "BasicCorpsProfitChange对象")
+public class BasicCorpsProfitChange implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+
+	/**
+	 * 客户id
+	 */
+	@ApiModelProperty(value = "订单id")
+	private Long orderId;
+
+	private String orderNo;
+
+
+	/**
+	* 客户id
+	*/
+		@ApiModelProperty(value = "客户id")
+		private Long corpId;
+	/**
+	 *
+	 *
+	* 变动总返利
+	*/
+		@ApiModelProperty(value = "变动总返利")
+		private BigDecimal changeProfitReturn;
+	/**
+	* 变动已用返利
+	*/
+		@ApiModelProperty(value = "变动已用返利")
+		private BigDecimal changeUsedProfit;
+	/**
+	* 变动可用返利
+	*/
+		@ApiModelProperty(value = "变动可用返利")
+		private BigDecimal changeSurplusProfit;
+	/**
+	* 变动本月待到账返利
+	*/
+		@ApiModelProperty(value = "变动本月待到账返利")
+		private BigDecimal changeMonthProfit;
+	/**
+	* 创建人
+	*/
+		@ApiModelProperty(value = "创建人")
+		private Long createUser;
+	/**
+	* 创建部门
+	*/
+		@ApiModelProperty(value = "创建部门")
+		private Long createDept;
+	/**
+	* 创建时间
+	*/
+		@ApiModelProperty(value = "创建时间")
+		private Date createTime;
+	/**
+	* 修改人
+	*/
+		@ApiModelProperty(value = "修改人")
+		private Long updateUser;
+	/**
+	* 修改时间
+	*/
+		@ApiModelProperty(value = "修改时间")
+		private LocalDateTime updateTime;
+	/**
+	* 状态(0 正常 1停用)
+	*/
+		@ApiModelProperty(value = "状态(0 正常 1停用)")
+		private Integer status;
+	/**
+	* 是否已删除(0 否 1是)
+	*/
+		@ApiModelProperty(value = "是否已删除(0 否 1是)")
+		private Integer isDeleted;
+
+
+}

+ 8 - 0
blade-service-api/blade-client-api/src/main/java/org/springblade/client/entity/CorpsDesc.java

@@ -311,4 +311,12 @@ public class CorpsDesc implements Serializable {
     private String swiftCode;
 
     private String cnaps;
+    //总返利
+    private BigDecimal profitReturn;
+    //已用返利
+    private BigDecimal usedProfit;
+    //可用返利
+    private BigDecimal surplusProfit;
+    //本月待到账返利
+    private BigDecimal monthProfit;
 }

+ 9 - 0
blade-service-api/blade-client-api/src/main/java/org/springblade/client/feign/ICorpsDescClient.java

@@ -8,6 +8,8 @@ import org.springblade.core.mp.support.BladePage;
 import org.springblade.core.tool.api.R;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
@@ -29,7 +31,12 @@ public interface ICorpsDescClient {
 	String LIST_BY_NAME = API_PREFIX + "/listCorpByName";
 	String LIST_BANK_BY_CORP_ID=API_PREFIX+"/listBankByCorpId";
 	String GET_CORPS_DESC= API_PREFIX + "/getCorpsDesc";
+	String CORPS_UPDATE= API_PREFIX + "/update";
 
+
+
+	@PostMapping(CORPS_UPDATE)
+	R corpsUpdate(@RequestBody CorpsDesc corpsDesc);
 	/**
 	 * 获取CorpsDesc列表
 	 *
@@ -89,4 +96,6 @@ public interface ICorpsDescClient {
 	@GetMapping(GET_CORPS_DESC)
 	CorpsDesc getCorpsDesc(@RequestParam("cname") String cname,@RequestParam("corpType") String corpType);
 
+
+
 }

+ 31 - 0
blade-service-api/blade-client-api/src/main/java/org/springblade/client/feign/ICorpsProfitChangeClient.java

@@ -0,0 +1,31 @@
+package org.springblade.client.feign;
+
+import org.springblade.client.entity.BasicCorpsProfitChange;
+import org.springblade.client.entity.CorpsBank;
+import org.springblade.client.entity.CorpsDesc;
+import org.springblade.client.vo.CorpsDescVO;
+import org.springblade.common.constant.LauncherConstant;
+import org.springblade.core.mp.support.BladePage;
+import org.springblade.core.tool.api.R;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
+
+@FeignClient(
+	value = LauncherConstant.APPLICATION_CLIENT_NAME
+)
+/**
+ * 返利变化feign
+ */
+public interface ICorpsProfitChangeClient
+{
+     //保存返利变动记录
+	@PostMapping("/basiccorpsprofitchange/save")
+	R save(@Valid @RequestBody BasicCorpsProfitChange basicCorpsProfitChange);
+}

+ 37 - 0
blade-service-api/blade-client-api/src/main/java/org/springblade/client/vo/BasicCorpsProfitChangeVO.java

@@ -0,0 +1,37 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.client.vo;
+
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import org.springblade.client.entity.BasicCorpsProfitChange;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2022-01-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "BasicCorpsProfitChangeVO对象", description = "BasicCorpsProfitChangeVO对象")
+public class BasicCorpsProfitChangeVO extends BasicCorpsProfitChange {
+	private static final long serialVersionUID = 1L;
+
+}

+ 4 - 0
blade-service-api/blade-purchase-sales-api/src/main/java/org/springblade/purchase/sales/entity/Order.java

@@ -703,4 +703,8 @@ public class Order implements Serializable {
 	private BigDecimal actualWeight;
 	@TableField(exist = false)
 	private String checkType;
+
+	private BigDecimal thisUsedProfit;
+
+	private BigDecimal createProfit;
 }

+ 2 - 0
blade-service-api/trade-finance-api/src/main/java/org/springblade/finance/vojo/Acc.java

@@ -299,5 +299,7 @@ public class Acc implements Serializable {
 	private String itemType;
 	@TableField(exist = false)
 	private List<Long> SrcFeesIds;
+	@TableField(exist = false)
+	private Integer flag;
 
 }

+ 1 - 1
blade-service/blade-check/src/main/java/org/springblade/check/service/impl/AuditProecessServiceImpl.java

@@ -666,7 +666,7 @@ public class AuditProecessServiceImpl extends ServiceImpl<AuditProecessMapper, A
 				R r = orderCheckClient.passCheck(auditProecess.getSrcBillId());
 				if(!r.isSuccess())
 				{
-					throw new SecurityException("修改财务数据失败");
+					throw new SecurityException(r.getMsg());
 				}
 
 

+ 116 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/controller/BasicCorpsProfitChangeController.java

@@ -0,0 +1,116 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.client.corps.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.client.corps.service.IBasicCorpsProfitChangeService;
+import org.springblade.client.entity.BasicCorpsProfitChange;
+import org.springblade.client.vo.BasicCorpsProfitChangeVO;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2022-01-14
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/basiccorpsprofitchange")
+@Api(value = "", tags = "接口")
+public class BasicCorpsProfitChangeController extends BladeController {
+
+	private final IBasicCorpsProfitChangeService basicCorpsProfitChangeService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入basicCorpsProfitChange")
+	public R<BasicCorpsProfitChange> detail(BasicCorpsProfitChange basicCorpsProfitChange) {
+		BasicCorpsProfitChange detail = basicCorpsProfitChangeService.getOne(Condition.getQueryWrapper(basicCorpsProfitChange));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入basicCorpsProfitChange")
+	public R<IPage<BasicCorpsProfitChange>> list(BasicCorpsProfitChange basicCorpsProfitChange, Query query) {
+		IPage<BasicCorpsProfitChange> pages = basicCorpsProfitChangeService.page(Condition.getPage(query), Condition.getQueryWrapper(basicCorpsProfitChange));
+		return R.data(pages);
+	}
+
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入basicCorpsProfitChange")
+	public R save(@Valid @RequestBody BasicCorpsProfitChange basicCorpsProfitChange) {
+		return R.status(basicCorpsProfitChangeService.save(basicCorpsProfitChange));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入basicCorpsProfitChange")
+	public R update(@Valid @RequestBody BasicCorpsProfitChange basicCorpsProfitChange) {
+		return R.status(basicCorpsProfitChangeService.updateById(basicCorpsProfitChange));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入basicCorpsProfitChange")
+	public R submit(@Valid @RequestBody BasicCorpsProfitChange basicCorpsProfitChange) {
+		return R.status(basicCorpsProfitChangeService.saveOrUpdate(basicCorpsProfitChange));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(basicCorpsProfitChangeService.removeByIds(Func.toLongList(ids)));
+	}
+
+
+}

+ 8 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/feign/CorpsDescClient.java

@@ -39,6 +39,14 @@ public class CorpsDescClient implements ICorpsDescClient {
 
 	private final ICorpsBankService bankService;
 
+
+	@Override
+	@PostMapping(CORPS_UPDATE)
+	public R corpsUpdate(CorpsDesc corpsDesc) {
+		boolean b = service.updateById(corpsDesc);
+		return R.status(b);
+	}
+
 	@Override
 	public BladePage<CorpsDesc> top(Integer current, Integer size) {
 		Query query = new Query();

+ 45 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/mapper/BasicCorpsProfitChangeMapper.java

@@ -0,0 +1,45 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.client.corps.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.client.entity.BasicCorpsProfitChange;
+import org.springblade.client.vo.BasicCorpsProfitChangeVO;
+
+import java.util.List;
+
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-01-14
+ */
+public interface BasicCorpsProfitChangeMapper extends BaseMapper<BasicCorpsProfitChange> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param basicCorpsProfitChange
+	 * @return
+	 */
+	List<BasicCorpsProfitChangeVO> selectBasicCorpsProfitChangePage(IPage page, BasicCorpsProfitChangeVO basicCorpsProfitChange);
+
+}

+ 7 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/mapper/BasicCorpsProfitChangeMapper.xml

@@ -0,0 +1,7 @@
+<?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="org.springblade.client.corps.mapper.BasicCorpsProfitChangeMapper">
+
+
+
+</mapper>

+ 33 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/service/IBasicCorpsProfitChangeService.java

@@ -0,0 +1,33 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.client.corps.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.client.entity.BasicCorpsProfitChange;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2022-01-14
+ */
+public interface IBasicCorpsProfitChangeService extends IService<BasicCorpsProfitChange> {
+
+
+
+}

+ 38 - 0
blade-service/blade-client/src/main/java/org/springblade/client/corps/service/impl/BasicCorpsProfitChangeServiceImpl.java

@@ -0,0 +1,38 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.client.corps.service.impl;
+
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.client.corps.mapper.BasicCorpsProfitChangeMapper;
+import org.springblade.client.corps.service.IBasicCorpsProfitChangeService;
+import org.springblade.client.entity.BasicCorpsProfitChange;
+import org.springframework.stereotype.Service;
+
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2022-01-14
+ */
+@Service
+public class BasicCorpsProfitChangeServiceImpl extends ServiceImpl<BasicCorpsProfitChangeMapper, BasicCorpsProfitChange> implements IBasicCorpsProfitChangeService {
+
+
+
+}

+ 1 - 0
blade-service/blade-client/src/main/java/org/springblade/client/message/controller/MessageController.java

@@ -89,6 +89,7 @@ public class MessageController extends BladeController {
 		messageLambdaQueryWrapper
 			.like(Message::getToUserId, AuthUtil.getUserId())
 			.eq(Message::getTenantId,AuthUtil.getTenantId())
+			.orderByDesc(Message::getCreateTime)
 		         .orderByAsc(Message::getIsRead);
 
 		List<Message> list = messageService.list(messageLambdaQueryWrapper);

+ 41 - 17
blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/service/impl/DeliveryServiceImpl.java

@@ -289,6 +289,19 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 	@GlobalTransactional
 	public void comfire(Delivery delivery)
 	{
+        //防重校验
+		Long deliveryId = delivery.getId();
+		Delivery select = baseMapper.selectById(deliveryId);
+		if(select==null)
+		{
+			throw new SecurityException("未查到相关数据,操作失败");
+		}
+		if(select.getDeliveryStatus()==null||!select.getDeliveryStatus().equals("已收货"))
+		{
+			throw new SecurityException("此单据已收货或者不存在,禁止重复操作");
+		}
+
+
 		    //保存收货单主表 和 收货单明细
 	       	this.submitDelivery(delivery);
 	       	//验证收货单库存与传入库存是否一致,如果一直则修改库存
@@ -332,22 +345,27 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 				// 比较2个库存值是否相等
 				//BigDecimal surplusRouteQuantity = stockGoodsVOR.getData().getSurplusRouteQuantity();
 
-				//新增库存单
-				if(stock==null)
-				{
-					StockGoods stockGoods = iDeliveryItemsService.saveStock(delivery.getTradeType(), delivery.getCorpId(), delivery.getStorageId(), e);
-					//更新收货单明细库存
-					e.setInventoryNumber(stockGoods.getSurplusRouteQuantity());
-					e.setInWeight(stockGoods.getInWeight());
-				}
-				//修改库存单
-				else if(stock!=null)
+				//达沃特新需求-禅道860中体现-国内-采购确认-不增加库存
+				if(!delivery.getTradeType().equals("GN"))
 				{
-					StockGoods receiving = iDeliveryItemsService.receiving(delivery.getTradeType(), stock.getId(), e);
-					//更新收货单明细库存
-					e.setInventoryNumber(receiving.getSurplusRouteQuantity());
-					e.setInWeight(receiving.getInWeight());
+					//新增库存单
+					if(stock==null)
+					{
+						StockGoods stockGoods = iDeliveryItemsService.saveStock(delivery.getTradeType(), delivery.getCorpId(), delivery.getStorageId(), e);
+						//更新收货单明细库存
+						e.setInventoryNumber(stockGoods.getSurplusRouteQuantity());
+						e.setInWeight(stockGoods.getInWeight());
+					}
+					//修改库存单
+					else if(stock!=null)
+					{
+						StockGoods receiving = iDeliveryItemsService.receiving(delivery.getTradeType(), stock.getId(), e);
+						//更新收货单明细库存
+						e.setInventoryNumber(receiving.getSurplusRouteQuantity());
+						e.setInWeight(receiving.getInWeight());
+					}
 				}
+
                 //更新item已发数量
 				R r = iOrderItemsClient.updateActualQuantity(e.getSrcId(), inventoryNumber, 1);
 				if(!r.isSuccess())
@@ -379,10 +397,16 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 	@GlobalTransactional
 	public void cancel(Delivery delivery)
 	{
-		 //判断当前收货单状态,是否可以撤销
-         if(delivery.getDeliveryStatus()==null||!delivery.getDeliveryStatus().equals("已收货"))
+		//防重校验
+		Long deliveryId = delivery.getId();
+		Delivery select = baseMapper.selectById(deliveryId);
+		if(select==null)
+		{
+			throw new SecurityException("未查到相关数据,操作失败");
+		}
+		if(select.getDeliveryStatus()==null||!select.getDeliveryStatus().equals("已收货"))
          {
-                throw new SecurityException("非已发货状态,禁止撤回");
+                throw new SecurityException("此单据已撤回或者不存在,禁止重复操作");
 		 }
 
 		 List<DeliveryItems> deliveryItemsList = delivery.getDeliveryItemsList();

+ 1 - 1
blade-service/blade-project/src/main/java/org/springblade/project/service/impl/ServiceProjectServiceImpl.java

@@ -479,7 +479,7 @@ public class ServiceProjectServiceImpl extends ServiceImpl<ServiceProjectMapper,
 			}
 			//主营项目子表操作
 			serviceProjectItem.setStatus(5);
-			serviceProjectItem.setPayTime(new Date());
+			serviceProjectItem.setPayTime(payTime);
 			serviceProjectItemMapper.updateById(serviceProjectItem);
 			//主营项目主表操作
 			ServiceProject targetServiceProject = serviceProjectMapper.selectById(serviceProjectItem.getPId());

+ 80 - 5
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/impl/OrderServiceImpl.java

@@ -32,13 +32,11 @@ import org.springblade.check.dto.AuditProecessDTO;
 import org.springblade.check.entity.AuditPathsActs;
 import org.springblade.check.entity.AuditPathsLevels;
 import org.springblade.check.feign.ICheckClient;
+import org.springblade.client.entity.BasicCorpsProfitChange;
 import org.springblade.client.entity.CorpsDesc;
 import org.springblade.client.entity.FeesDesc;
 import org.springblade.client.entity.GoodsDesc;
-import org.springblade.client.feign.ICorpsDescClient;
-import org.springblade.client.feign.IFeesDescClient;
-import org.springblade.client.feign.IGoodsDescClient;
-import org.springblade.client.feign.ISerialClient;
+import org.springblade.client.feign.*;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
@@ -83,6 +81,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	private ICorpsDescClient corpsDescClient;//获取客户信息
 	private OrderMapper orderMapper;
 	private final ICheckClient iCheckClient;
+	private ICorpsProfitChangeClient corpsProfitChangeClient;
 	@Override
 	public IPage<OrderVO> selectOrderPage(IPage<OrderVO> page, OrderVO order) {
 		List<OrderVO> orderVOList = baseMapper.selectOrderPage(page, order);
@@ -210,7 +209,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 					return x.add(y.getPurchaseAmount().multiply(y.getOrderQuantity()));
 				},BigDecimal::add);//采购金额求和
 				BigDecimal amount = list.stream().map(OrderItems::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);//金额求和
-				BigDecimal grossProfit = amount.subtract(reduce.add(order.getPredictOceanFreight()));//毛利润
+				BigDecimal grossProfit = amount.subtract(reduce.add(order.getPredictOceanFreight())).subtract(order.getThisUsedProfit());
 				BigDecimal grossProfitRate = new BigDecimal(BigInteger.ZERO);
 				if (amount.compareTo(BigDecimal.ZERO) > 0){
 					grossProfitRate = (grossProfit.divide(amount,2)).multiply(new BigDecimal(100));
@@ -600,6 +599,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
+	@Transactional
+	@GlobalTransactional
 	public void passCheck(Long id)
 	{
 		LambdaQueryWrapper<Order> orderLambdaQueryWrapper=new LambdaQueryWrapper<>();
@@ -613,6 +614,80 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 		}
 		order.setStatus(3);
 		baseMapper.updateById(order);
+
+		//不需要计算返利
+		if((order.getThisUsedProfit()==null|| order.getThisUsedProfit().compareTo(new BigDecimal("0"))==0) && (order.getCreateProfit()==null|| order.getCreateProfit().compareTo(new BigDecimal("0"))==0))
+		{
+			return;
+		}
+		//检查是否使用返利,如果使用返利
+		BasicCorpsProfitChange basicCorpsProfitChange=new BasicCorpsProfitChange();
+		basicCorpsProfitChange.setCorpId(order.getCorpId());
+		basicCorpsProfitChange.setOrderId(order.getId());
+		basicCorpsProfitChange.setOrderNo(order.getOrderNo());
+		basicCorpsProfitChange.setCreateTime(new Date());
+		basicCorpsProfitChange.setCreateUser(AuthUtil.getUserId());
+		//有返利
+		if(order.getThisUsedProfit()!=null && order.getThisUsedProfit().compareTo(BigDecimal.ZERO)==1)
+		{
+			//增加客户的总返利
+			/*basicCorpsProfitChange.setChangeProfitReturn(order.getThisUsedProfit());*/
+			//增加客户的已用返利
+			basicCorpsProfitChange.setChangeUsedProfit(order.getThisUsedProfit());
+			//减少客户的可用返利
+			basicCorpsProfitChange.setChangeSurplusProfit(order.getThisUsedProfit().negate());
+		}
+		//检查是否含有产生返利,如果有, 需要增加客户的本月待到账返利
+		 if(order.getCreateProfit()!=null && order.getCreateProfit().compareTo(BigDecimal.ZERO)==1)
+		{
+				//增加客户的月返利
+				basicCorpsProfitChange.setChangeMonthProfit(order.getCreateProfit());
+
+		}
+		//新增返利变动记录
+		R save = corpsProfitChangeClient.save(basicCorpsProfitChange);
+		if(!save.isSuccess())
+		{
+			throw new SecurityException("保存返利变动记录失败");
+		}
+		//修改客户返利
+		R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(order.getCorpId());
+		if(!corpMessage.isSuccess()||corpMessage.getData()==null)
+		{
+			throw new SecurityException("未查到客户记录");
+		}
+		CorpsDesc corpsDesc = corpMessage.getData();
+		corpsDesc.setProfitReturn(basicCorpsProfitChange.getChangeProfitReturn()==null?new BigDecimal("0").add(corpsDesc.getProfitReturn()):basicCorpsProfitChange.getChangeProfitReturn().add(corpsDesc.getProfitReturn()));
+		corpsDesc.setUsedProfit(basicCorpsProfitChange.getChangeUsedProfit()==null?new BigDecimal("0").add(corpsDesc.getUsedProfit()):basicCorpsProfitChange.getChangeUsedProfit().add(corpsDesc.getUsedProfit()));
+		corpsDesc.setSurplusProfit(basicCorpsProfitChange.getChangeSurplusProfit()==null?new BigDecimal("0").add(corpsDesc.getSurplusProfit()):basicCorpsProfitChange.getChangeSurplusProfit().add(corpsDesc.getSurplusProfit()));
+		corpsDesc.setMonthProfit(basicCorpsProfitChange.getChangeMonthProfit()==null?new BigDecimal("0").add(corpsDesc.getMonthProfit()):basicCorpsProfitChange.getChangeMonthProfit().add(corpsDesc.getMonthProfit()));
+
+		if(corpsDesc.getProfitReturn().compareTo(new BigDecimal("0"))==-1)
+		{
+             throw new SecurityException("修改客户返利失败:总返利不能为负数");
+		}
+		if(corpsDesc.getUsedProfit().compareTo(new BigDecimal("0"))==-1)
+		{
+			throw new SecurityException("修改客户返利失败:已用返利不能为负数");
+		}
+		if(corpsDesc.getSurplusProfit().compareTo(new BigDecimal("0"))==-1)
+		{
+			throw new SecurityException("修改客户返利失败:可用返利不能为负数");
+		}
+		if(corpsDesc.getMonthProfit().compareTo(new BigDecimal("0"))==-1)
+		{
+			throw new SecurityException("修改客户返利失败:本月待到账返利不能为负数");
+		}
+		//更新客户返利情况
+		R corpsUpdate = corpsDescClient.corpsUpdate(corpsDesc);
+		if(!corpsUpdate.isSuccess())
+		{
+			throw new SecurityException("更新客户返利信息失败");
+		}
+
+
+
+
 	}
 
 	@Override

+ 4 - 0
blade-service/trade-finance/src/main/java/org/springblade/finance/controller/AccController.java

@@ -101,6 +101,10 @@ public class AccController extends BladeController {
 	public R<IPage<Acc>> list(Acc acc, Query query)
 	{
 		LambdaQueryWrapper<Acc> accLambdaQueryWrapper=new LambdaQueryWrapper<>();
+		if(acc.getFlag()==1)
+		{
+			accLambdaQueryWrapper.apply(" Amount >Settlement_Amount");
+		}
 		accLambdaQueryWrapper.between(StringUtils.isNotBlank(acc.getCreateStartDate())&&StringUtils.isNotBlank(acc.getCreateEndDate()), Acc::getCreateTime,acc.getCreateStartDate(),acc.getCreateEndDate());
 		accLambdaQueryWrapper.like(StringUtils.isNotBlank(acc.getBillType()),Acc::getBillType,acc.getBillType());
 		accLambdaQueryWrapper.like(StringUtils.isNotBlank(acc.getAccSysNo()),Acc::getAccSysNo,acc.getAccSysNo());