Browse Source

商品新增分部成本价

zouxuan 2 years ago
parent
commit
98b6ff74f6

+ 8 - 355
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Goods.java

@@ -3,10 +3,9 @@ package com.ym.mec.biz.dal.entity;
 import com.ym.mec.biz.dal.enums.GoodsType;
 import com.ym.mec.biz.dal.enums.StockType;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
-import com.ym.mec.common.entity.BaseEntity;
-
+import com.ym.mec.common.tenant.TenantContextHolder;
 import io.swagger.annotations.ApiModelProperty;
-
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 import java.math.BigDecimal;
@@ -15,7 +14,8 @@ import java.util.List;
 /**
  * 对应数据库表(goods):
  */
-public class Goods extends BaseEntity {
+@Data
+public class Goods {
 
 	/** 商品编号 */
 	@ApiModelProperty(value = "商品编号",required = false)
@@ -79,6 +79,9 @@ public class Goods extends BaseEntity {
 	@ApiModelProperty(value = "协议成本价",required = false)
 	private BigDecimal agreeCostPrice;
 
+	@ApiModelProperty(value = "分部成本价",required = false)
+	private BigDecimal organCostPrice;
+
 	/** 页面简介 */
 	@ApiModelProperty(value = "页面简介",required = false)
 	private String brief;
@@ -172,357 +175,7 @@ public class Goods extends BaseEntity {
 	@ApiModelProperty(value = "库存预警")
 	private YesOrNoEnum stockWarning;
 
-	public String getStudentShowOrganId() {
-		return studentShowOrganId;
-	}
-
-	public void setStudentShowOrganId(String studentShowOrganId) {
-		this.studentShowOrganId = studentShowOrganId;
-	}
-
-	public String getEducationShowOrganId() {
-		return educationShowOrganId;
-	}
-
-	public void setEducationShowOrganId(String educationShowOrganId) {
-		this.educationShowOrganId = educationShowOrganId;
-	}
-
-	public String getCourseFeeShowOrganId() {
-		return courseFeeShowOrganId;
-	}
-
-	public void setCourseFeeShowOrganId(String courseFeeShowOrganId) {
-		this.courseFeeShowOrganId = courseFeeShowOrganId;
-	}
-
-	public String getMemberFeeShowOrganId() {
-		return memberFeeShowOrganId;
-	}
-
-	public void setMemberFeeShowOrganId(String memberFeeShowOrganId) {
-		this.memberFeeShowOrganId = memberFeeShowOrganId;
-	}
-
-	public String getReplacementShowOrganId() {
-		return replacementShowOrganId;
-	}
-
-	public void setReplacementShowOrganId(String replacementShowOrganId) {
-		this.replacementShowOrganId = replacementShowOrganId;
-	}
-
-	public String getStudentShowOrganName() {
-		return studentShowOrganName;
-	}
-
-	public void setStudentShowOrganName(String studentShowOrganName) {
-		this.studentShowOrganName = studentShowOrganName;
-	}
-
-	public String getEducationShowOrganName() {
-		return educationShowOrganName;
-	}
-
-	public void setEducationShowOrganName(String educationShowOrganName) {
-		this.educationShowOrganName = educationShowOrganName;
-	}
-
-	public String getCourseFeeShowOrganName() {
-		return courseFeeShowOrganName;
-	}
-
-	public void setCourseFeeShowOrganName(String courseFeeShowOrganName) {
-		this.courseFeeShowOrganName = courseFeeShowOrganName;
-	}
-
-	public String getMemberFeeShowOrganName() {
-		return memberFeeShowOrganName;
-	}
-
-	public void setMemberFeeShowOrganName(String memberFeeShowOrganName) {
-		this.memberFeeShowOrganName = memberFeeShowOrganName;
-	}
-
-	public String getReplacementShowOrganName() {
-		return replacementShowOrganName;
-	}
-
-	public void setReplacementShowOrganName(String replacementShowOrganName) {
-		this.replacementShowOrganName = replacementShowOrganName;
-	}
-
-	public YesOrNoEnum getStockWarning() {
-		return stockWarning;
-	}
-
-	public void setStockWarning(YesOrNoEnum stockWarning) {
-		this.stockWarning = stockWarning;
-	}
-
-	public StockType getStockType() {
-		return stockType;
-	}
-
-	public void setStockType(StockType stockType) {
-		this.stockType = stockType;
-	}
-
-	public BigDecimal getAgreeCostPrice() {
-		return agreeCostPrice;
-	}
-
-	public void setAgreeCostPrice(BigDecimal agreeCostPrice) {
-		this.agreeCostPrice = agreeCostPrice;
-	}
-
-	public String getSubjectIds() {
-        return subjectIds;
-    }
-
-    public void setSubjectIds(String subjectIds) {
-        this.subjectIds = subjectIds;
-    }
-
-	public BigDecimal getCostPrice() {
-		return costPrice;
-	}
-
-	public void setCostPrice(BigDecimal costPrice) {
-		this.costPrice = costPrice;
-	}
-
-	public String getGoodsCategoryName() {
-		return goodsCategoryName;
-	}
-
-	public void setGoodsCategoryName(String goodsCategoryName) {
-		this.goodsCategoryName = goodsCategoryName;
-	}
-
-	public GoodsType getType() {
-		return type;
-	}
-
-	public void setType(GoodsType type) {
-		this.type = type;
-	}
-
-	public String getComplementGoodsIdList() {
-		return complementGoodsIdList;
-	}
-
-	public void setComplementGoodsIdList(String complementGoodsIdList) {
-		this.complementGoodsIdList = complementGoodsIdList;
-	}
-
-	public void setId(Integer id){
-		this.id = id;
-	}
-
-	public Integer getId(){
-		return this.id;
-	}
-
-	public void setGoodsCategoryId(Integer goodsCategoryId){
-		this.goodsCategoryId = goodsCategoryId;
-	}
-
-	public Integer getGoodsCategoryId(){
-		return this.goodsCategoryId;
-	}
-
-	public void setSn(String sn){
-		this.sn = sn;
-	}
-
-	public String getSn(){
-		return this.sn;
-	}
-
-	public void setName(String name){
-		this.name = name;
-	}
-
-	public String getName(){
-		return this.name;
-	}
-
-	public void setBrand(String brand){
-		this.brand = brand;
-	}
-
-	public String getBrand(){
-		return this.brand;
-	}
-
-	public void setSpecification(String specification){
-		this.specification = specification;
-	}
-
-	public String getSpecification(){
-		return this.specification;
-	}
-
-	public void setImage(String image){
-		this.image = image;
-	}
-
-	public String getImage(){
-		return this.image;
-	}
-
-	public void setStockCount(Integer stockCount){
-		this.stockCount = stockCount;
-	}
-
-	public Integer getStockCount(){
-		return this.stockCount;
-	}
-
-	public void setSellCount(Integer sellCount){
-		this.sellCount = sellCount;
-	}
-
-	public Integer getSellCount(){
-		return this.sellCount;
-	}
-
-	public BigDecimal getMarketPrice() {
-		return marketPrice;
-	}
-
-	public void setMarketPrice(BigDecimal marketPrice) {
-		this.marketPrice = marketPrice;
-	}
-
-	public BigDecimal getDiscountPrice() {
-		return discountPrice;
-	}
-
-	public void setDiscountPrice(BigDecimal discountPrice) {
-		this.discountPrice = discountPrice;
-	}
-
-	public BigDecimal getGroupPurchasePrice() {
-		return groupPurchasePrice;
-	}
-
-	public void setGroupPurchasePrice(BigDecimal groupPurchasePrice) {
-		this.groupPurchasePrice = groupPurchasePrice;
-	}
-
-	public void setBrief(String brief){
-		this.brief = brief;
-	}
-
-	public String getBrief(){
-		return this.brief;
-	}
-
-	public void setDesc(String desc){
-		this.desc = desc;
-	}
-
-	public String getDesc(){
-		return this.desc;
-	}
-
-	public YesOrNoEnum getIsNew() {
-		return isNew;
-	}
-
-	public void setIsNew(YesOrNoEnum isNew) {
-		this.isNew = isNew;
-	}
-
-	public YesOrNoEnum getIsTop() {
-		return isTop;
-	}
-
-	public void setIsTop(YesOrNoEnum isTop) {
-		this.isTop = isTop;
-	}
-
-	public YesOrNoEnum getStatus() {
-		return status;
-	}
-
-	public void setStatus(YesOrNoEnum status) {
-		this.status = status;
-	}
-
-	public void setMemo(String memo){
-		this.memo = memo;
-	}
-
-	public String getMemo(){
-		return this.memo;
-	}
-
-	public void setPublishTime(java.util.Date publishTime){
-		this.publishTime = publishTime;
-	}
-
-	public java.util.Date getPublishTime(){
-		return this.publishTime;
-	}
-
-	public void setCreateTime(java.util.Date createTime){
-		this.createTime = createTime;
-	}
-
-	public java.util.Date getCreateTime(){
-		return this.createTime;
-	}
-
-	public void setUpdateTime(java.util.Date updateTime){
-		this.updateTime = updateTime;
-	}
-
-	public java.util.Date getUpdateTime(){
-		return this.updateTime;
-	}
-
-	public List<Goods> getGoodsList() {
-		return goodsList;
-	}
-
-	public void setGoodsList(List<Goods> goodsList) {
-		this.goodsList = goodsList;
-	}
-
-	public Integer getTaxStockCount() {
-		return taxStockCount;
-	}
-
-	public void setTaxStockCount(Integer taxStockCount) {
-		this.taxStockCount = taxStockCount;
-	}
-
-	public String getSupplyChannel() {
-		return supplyChannel;
-	}
-
-	public void setSupplyChannel(String supplyChannel) {
-		this.supplyChannel = supplyChannel;
-	}
-
-	public String getFreeFeeShowOrganId() {
-		return freeFeeShowOrganId;
-	}
-
-	public void setFreeFeeShowOrganId(String freeFeeShowOrganId) {
-		this.freeFeeShowOrganId = freeFeeShowOrganId;
-	}
-
-	public String getFreeFeeShowOrganName() {
-		return freeFeeShowOrganName;
-	}
-
-	public void setFreeFeeShowOrganName(String freeFeeShowOrganName) {
-		this.freeFeeShowOrganName = freeFeeShowOrganName;
-	}
+	private Integer tenantId = TenantContextHolder.getTenantId();
 
 	@Override
 	public String toString() {

+ 9 - 407
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SellOrder.java

@@ -6,127 +6,78 @@ import com.ym.mec.biz.dal.enums.SellTypeEnum;
 import com.ym.mec.biz.dal.enums.StockType;
 import com.ym.mec.common.entity.BaseEntity;
 
+import com.ym.mec.common.tenant.TenantContextHolder;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 import java.math.BigDecimal;
 import java.util.Date;
 
 @ApiModel(value="com-ym-SellOrder")
-public class SellOrder extends BaseEntity {
-    @ApiModelProperty(value="")
+@Data
+public class SellOrder{
     private Integer id;
 
-    /**
-     * 教务id
-     */
     @ApiModelProperty(value="教务id")
     private Integer eduTeacherId;
 
     @ApiModelProperty(value="教务老师")
     private String eduTeacher;
 
-    /**
-    * 分部id
-    */
     @ApiModelProperty(value="分部id")
     private Integer organId;
 
-    /**
-     * 学校id
-     */
     @ApiModelProperty(value="学校id")
     private Integer cooperationOrganId;
 
-    /**
-     * 学校名称
-     */
     @ApiModelProperty(value="学校名称")
     private String schoolName;
 
-    /**
-    * 交易流水号
-    */
     @ApiModelProperty(value="交易流水号")
     private String transNo;
 
-    /**
-     * 交易流水号
-     */
     @ApiModelProperty(value="订单id")
     private Long orderId;
 
     private String organName;
 
-    /**
-    * 订单号
-    */
     @ApiModelProperty(value="订单号")
     private String orderNo;
 
-    /**
-    * 应付金额
-    */
     @ApiModelProperty(value="应付金额")
     private BigDecimal expectAmount = BigDecimal.ZERO;
 
-    /**
-    * 现金支付金额
-    */
     @ApiModelProperty(value="现金支付金额")
     private BigDecimal actualAmount = BigDecimal.ZERO;
 
-    /**
-    * 余额支付金额
-    */
     @ApiModelProperty(value="余额支付金额")
     private BigDecimal balanceAmount = BigDecimal.ZERO;
 
-    /**
-    * 销售成本
-    */
-    @ApiModelProperty(value="销售成本")
+    @ApiModelProperty(value="总部销售成本")
     private BigDecimal sellCost;
 
-    /**
-     * 销售成本2
-     */
+    @ApiModelProperty(value="分部销售成本")
+    private BigDecimal organSellCost;
+
     @ApiModelProperty(value="销售成本2")
     private String sellCost2;
 
-    /**
-    * 销售类型
-    */
     @ApiModelProperty(value="销售类型")
     private SellTypeEnum type;
 
-    /**
-     * 组合商品id
-     */
     @ApiModelProperty(value="组合商品id")
     private Integer parentGoodsId;
 
-    /**
-    * 商品id
-    */
     @ApiModelProperty(value="商品id")
     private Integer goodsId;
 
-    /**
-     * 商品名称
-     */
     @ApiModelProperty(value="商品名称")
     private String goodsName;
 
-    /**
-    * 数量
-    */
     @ApiModelProperty(value="数量")
     private Integer num;
 
-    /**
-    * 用户id
-    */
     @ApiModelProperty(value="用户id")
     private Integer userId;
 
@@ -134,68 +85,37 @@ public class SellOrder extends BaseEntity {
 
     private String phone;
 
-    /**
-    * 交易方式
-    */
     @ApiModelProperty(value="交易方式")
     private String paymentChannel;
 
     private String paymentChannelStr;
 
-    /**
-    * 收款账户
-    */
     @ApiModelProperty(value="收款账户")
     private String merNo;
 
-    /**
-     * 批次号
-     */
     @ApiModelProperty(value="批次号")
     private String batchNo;
 
-    /**
-    * 库存类型
-    */
     @ApiModelProperty(value="库存类型")
     private StockType stockType;
 
-    /**
-     * 账户类型
-     */
     @ApiModelProperty(value = "账户类型")
     private AccountType accountType;
 
     private String accountTypeStr;
 
-    /**
-     * 状态
-     */
     @ApiModelProperty(value = "状态")
     private SellStatus status;
 
-
-    /**
-     * 退货时间
-     */
     @ApiModelProperty(value="退货时间")
     private Date refundTime;
 
-    /**
-    * 交易时间
-    */
     @ApiModelProperty(value="交易时间")
     private Date sellTime;
 
-    /**
-    * 创建时间
-    */
     @ApiModelProperty(value="创建时间")
     private Date createIme;
 
-    /**
-    * 更新时间
-    */
     @ApiModelProperty(value="更新时间")
     private Date updateTime;
 
@@ -212,323 +132,5 @@ public class SellOrder extends BaseEntity {
     @ApiModelProperty(value="订单金额")
     private BigDecimal orderAmount = BigDecimal.ZERO;
 
-    public BigDecimal getOrderAmount() {
-        return orderAmount;
-    }
-
-    public void setOrderAmount(BigDecimal orderAmount) {
-        this.orderAmount = orderAmount;
-    }
-
-    public BigDecimal getCouponRemitAmount() {
-        return couponRemitAmount;
-    }
-
-    public void setCouponRemitAmount(BigDecimal couponRemitAmount) {
-        this.couponRemitAmount = couponRemitAmount;
-    }
-
-    public String getReceiveStatus() {
-        return receiveStatus;
-    }
-
-    public void setReceiveStatus(String receiveStatus) {
-        this.receiveStatus = receiveStatus;
-    }
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public Integer getOrganId() {
-        return organId;
-    }
-
-    public void setOrganId(Integer organId) {
-        this.organId = organId;
-    }
-
-    public Integer getCooperationOrganId() {
-        return cooperationOrganId;
-    }
-
-    public void setCooperationOrganId(Integer cooperationOrganId) {
-        this.cooperationOrganId = cooperationOrganId;
-    }
-
-    public String getTransNo() {
-        return transNo;
-    }
-
-    public void setTransNo(String transNo) {
-        this.transNo = transNo;
-    }
-
-    public String getOrderNo() {
-        return orderNo;
-    }
-
-    public void setOrderNo(String orderNo) {
-        this.orderNo = orderNo;
-    }
-
-    public BigDecimal getExpectAmount() {
-        return expectAmount;
-    }
-
-    public void setExpectAmount(BigDecimal expectAmount) {
-        this.expectAmount = expectAmount;
-    }
-
-    public BigDecimal getActualAmount() {
-        return actualAmount;
-    }
-
-    public void setActualAmount(BigDecimal actualAmount) {
-        this.actualAmount = actualAmount;
-    }
-
-    public BigDecimal getBalanceAmount() {
-        return balanceAmount;
-    }
-
-    public void setBalanceAmount(BigDecimal balanceAmount) {
-        this.balanceAmount = balanceAmount;
-    }
-
-    public BigDecimal getSellCost() {
-        return sellCost;
-    }
-
-    public void setSellCost(BigDecimal sellCost) {
-        this.sellCost = sellCost;
-    }
-
-    public SellTypeEnum getType() {
-        return type;
-    }
-
-    public void setType(SellTypeEnum type) {
-        this.type = type;
-    }
-
-    public Integer getGoodsId() {
-        return goodsId;
-    }
-
-    public void setGoodsId(Integer goodsId) {
-        this.goodsId = goodsId;
-    }
-
-    public Integer getNum() {
-        return num;
-    }
-
-    public void setNum(Integer num) {
-        this.num = num;
-    }
-
-    public Integer getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Integer userId) {
-        this.userId = userId;
-    }
-
-    public String getPaymentChannel() {
-        return paymentChannel;
-    }
-
-    public void setPaymentChannel(String paymentChannel) {
-        this.paymentChannel = paymentChannel;
-    }
-
-    public String getMerNo() {
-        return merNo;
-    }
-
-    public void setMerNo(String merNo) {
-        this.merNo = merNo;
-    }
-
-    public Date getSellTime() {
-        return sellTime;
-    }
-
-    public void setSellTime(Date sellTime) {
-        this.sellTime = sellTime;
-    }
-
-    public Date getCreateIme() {
-        return createIme;
-    }
-
-    public void setCreateIme(Date createIme) {
-        this.createIme = createIme;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public String getGoodsName() {
-        return goodsName;
-    }
-
-    public void setGoodsName(String goodsName) {
-        this.goodsName = goodsName;
-    }
-
-    public String getSellCost2() {
-        return sellCost2;
-    }
-
-    public void setSellCost2(String sellCost2) {
-        this.sellCost2 = sellCost2;
-    }
-
-    public Long getOrderId() {
-        return orderId;
-    }
-
-    public void setOrderId(Long orderId) {
-        this.orderId = orderId;
-    }
-
-    public String getUserName() {
-        return userName;
-    }
-
-    public void setUserName(String userName) {
-        this.userName = userName;
-    }
-
-    public String getPhone() {
-        return phone;
-    }
-
-    public void setPhone(String phone) {
-        this.phone = phone;
-    }
-
-    public String getOrganName() {
-        return organName;
-    }
-
-    public void setOrganName(String organName) {
-        this.organName = organName;
-    }
-
-    public String getSchoolName() {
-        return schoolName;
-    }
-
-    public void setSchoolName(String schoolName) {
-        this.schoolName = schoolName;
-    }
-
-    public Integer getEduTeacherId() {
-        return eduTeacherId;
-    }
-
-    public void setEduTeacherId(Integer eduTeacherId) {
-        this.eduTeacherId = eduTeacherId;
-    }
-
-    public String getEduTeacher() {
-        return eduTeacher;
-    }
-
-    public void setEduTeacher(String eduTeacher) {
-        this.eduTeacher = eduTeacher;
-    }
-
-    public StockType getStockType() {
-        return stockType;
-    }
-
-    public void setStockType(StockType stockType) {
-        this.stockType = stockType;
-    }
-
-    public AccountType getAccountType() {
-        return accountType;
-    }
-
-    public void setAccountType(AccountType accountType) {
-        this.accountType = accountType;
-    }
-
-    public String getBatchNo() {
-        return batchNo;
-    }
-
-    public void setBatchNo(String batchNo) {
-        this.batchNo = batchNo;
-    }
-
-    public SellStatus getStatus() {
-        return status;
-    }
-
-    public void setStatus(SellStatus status) {
-        this.status = status;
-    }
-
-    public Integer getParentGoodsId() {
-        return parentGoodsId;
-    }
-
-    public void setParentGoodsId(Integer parentGoodsId) {
-        this.parentGoodsId = parentGoodsId;
-    }
-
-    public Date getRefundTime() {
-        return refundTime;
-    }
-
-    public void setRefundTime(Date refundTime) {
-        this.refundTime = refundTime;
-    }
-
-    public Boolean getHasRoute() {
-        return hasRoute;
-    }
-
-    public void setHasRoute(Boolean hasRoute) {
-        this.hasRoute = hasRoute;
-    }
-
-    public String getPaymentChannelStr() {
-        return paymentChannelStr;
-    }
-
-    public void setPaymentChannelStr(String paymentChannelStr) {
-        this.paymentChannelStr = paymentChannelStr;
-    }
-
-    public String getAccountTypeStr() {
-        return accountTypeStr;
-    }
-
-    public void setAccountTypeStr(String accountTypeStr) {
-        this.accountTypeStr = accountTypeStr;
-    }
-
-    public String getReceiveStatusStr() {
-        return receiveStatusStr;
-    }
-
-    public void setReceiveStatusStr(String receiveStatusStr) {
-        this.receiveStatusStr = receiveStatusStr;
-    }
+    private Integer tenantId = TenantContextHolder.getTenantId();
 }

+ 3 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java

@@ -434,7 +434,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 					goodsProcurement.setTaxStockSoldNum(new AtomicInteger(goodsProcurement.getTaxStockSoldNum()).incrementAndGet());
 				}
 			}
-
+			//如果有采购清单,初始化总部成本价
 			if(Objects.nonNull(goodsProcurement)){
 				goodsProcurementDao.update(goodsProcurement);
 				noneBatchNoSellOrder.setBatchNo(goodsProcurement.getBatchNo());
@@ -525,6 +525,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 					sellOrder.setGoodsName(goods.getName());
 					sellOrder.setAccountType(accountType);
 					sellOrder.setBatchNo(batchNoGoodsIdMapEntry.getKey());
+					sellOrder.setOrganSellCost(goods.getOrganCostPrice());
 					GoodsProcurement goodsProcurement = goodsProcurementDao.getWithGoodsAndBatchNo(sellOrder.getGoodsId(), sellOrder.getBatchNo());
 					sellOrder.setSellCost(goodsProcurement.getDiscountPrice());
 					Map<String, BigDecimal> CostMap = new HashMap<>();
@@ -555,6 +556,7 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 				sellOrder.setGoodsName(goods.getName());
 				sellOrder.setAccountType(accountType);
 				sellOrder.setBatchNo(goodsProcurement.getBatchNo());
+				sellOrder.setOrganSellCost(goods.getOrganCostPrice());
 				if(Objects.nonNull(goodsProcurement.getBatchNo())){
 					sellOrder.setSellCost(goodsProcurement.getDiscountPrice());
 					Map<String, BigDecimal> CostMap = new HashMap<>();

+ 15 - 4
mec-biz/src/main/resources/config/mybatis/GoodsMapper.xml

@@ -22,6 +22,7 @@
         <result column="discount_price_" property="discountPrice"/>
         <result column="group_purchase_price_" property="groupPurchasePrice"/>
         <result column="agree_cost_price_" property="agreeCostPrice"/>
+        <result column="organ_cost_price_" property="organCostPrice"/>
         <result column="brief_" property="brief"/>
         <result column="desc_" property="desc"/>
         <result column="is_new_" property="isNew" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
@@ -73,20 +74,23 @@
         (goods_category_id_,sn_,name_,brand_,specification_,image_,stock_count_,tax_stock_count_,sell_count_,market_price_,
         discount_price_,group_purchase_price_,brief_,desc_,is_new_,is_top_,status_,memo_,publish_time_,
         complement_goods_id_list_,update_time_,create_time_,type_,agree_cost_price_,stock_warning_,stock_type_
-            ,student_show_organ_id_,education_show_organ_id_,replacement_show_organ_id_,course_fee_show_organ_id_,member_fee_show_organ_id_,free_fee_show_organ_id_,tenant_id_)
+            ,student_show_organ_id_,education_show_organ_id_,replacement_show_organ_id_,course_fee_show_organ_id_,
+         member_fee_show_organ_id_,free_fee_show_organ_id_,tenant_id_,organ_cost_price_)
         VALUES(#{goodsCategoryId},#{sn},#{name},#{brand},#{specification},#{image},#{stockCount},#{taxStockCount},#{sellCount},#{marketPrice},
         #{discountPrice},#{groupPurchasePrice},#{brief},#{desc},
         #{isNew,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isTop,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{memo},#{publishTime},#{complementGoodsIdList},now(),now(),#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{agreeCostPrice},
         #{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{studentShowOrganId},#{educationShowOrganId},#{replacementShowOrganId},#{courseFeeShowOrganId},#{memberFeeShowOrganId},#{freeFeeShowOrganId},#{tenantId})
+        #{studentShowOrganId},#{educationShowOrganId},#{replacementShowOrganId},#{courseFeeShowOrganId},
+               #{memberFeeShowOrganId},#{freeFeeShowOrganId},#{tenantId},#{organCostPrice})
     </insert>
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
         INSERT INTO goods
         (goods_category_id_,name_,brand_,specification_,image_,market_price_,
         discount_price_,group_purchase_price_,brief_,desc_,update_time_,create_time_,type_,agree_cost_price_,sn_,
         stock_count_,tax_stock_count_,stock_warning_,stock_type_
-        ,student_show_organ_id_,education_show_organ_id_,replacement_show_organ_id_,course_fee_show_organ_id_,member_fee_show_organ_id_,free_fee_show_organ_id_,tenant_id_)
+        ,student_show_organ_id_,education_show_organ_id_,replacement_show_organ_id_,course_fee_show_organ_id_,
+         member_fee_show_organ_id_,free_fee_show_organ_id_,tenant_id_,organ_cost_price_)
         VALUES
         <foreach collection="list" separator="," item="goods">
             (#{goods.goodsCategoryId},#{goods.name},#{goods.brand},#{goods.specification},#{goods.image},#{goods.marketPrice},
@@ -95,7 +99,8 @@
             #{goods.stockCount},#{goods.taxStockCount},
             #{goods.stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             #{goods.stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-            #{goods.studentShowOrganId},#{goods.educationShowOrganId},#{goods.replacementShowOrganId},#{goods.courseFeeShowOrganId},#{goods.memberFeeShowOrganId},,#{goods.freeFeeShowOrganId},#{goods.tenantId}
+            #{goods.studentShowOrganId},#{goods.educationShowOrganId},#{goods.replacementShowOrganId},
+             #{goods.courseFeeShowOrganId},#{goods.memberFeeShowOrganId},#{goods.freeFeeShowOrganId},#{goods.tenantId},#{goods.organCostPrice}
             )
         </foreach>
     </insert>
@@ -112,6 +117,9 @@
             <if test="agreeCostPrice != null">
                 agree_cost_price_ = #{agreeCostPrice},
             </if>
+            <if test="organCostPrice != null">
+                organ_cost_price_ = #{organCostPrice},
+            </if>
             <if test="specification != null">
                 specification_ = #{specification},
             </if>
@@ -211,6 +219,9 @@
                 <if test="goods.agreeCostPrice != null">
                     agree_cost_price_ = #{goods.agreeCostPrice},
                 </if>
+                <if test="goods.organCostPrice != null">
+                    organ_cost_price_ = #{goods.organCostPrice},
+                </if>
                 <if test="goods.specification != null">
                     specification_ = #{goods.specification},
                 </if>

+ 13 - 5
mec-biz/src/main/resources/config/mybatis/SellOrderMapper.xml

@@ -23,6 +23,7 @@
         <result column="goods_id_" property="goodsId"/>
         <result column="goods_name_" property="goodsName"/>
         <result column="sell_cost_" property="sellCost"/>
+        <result column="organ_sell_cost_" property="organSellCost"/>
         <result column="sell_cost2_" property="sellCost2"/>
         <result column="num_" property="num"/>
         <result column="user_id_" property="userId"/>
@@ -49,7 +50,7 @@
         actual_amount_,balance_amount_, sell_cost_, sell_cost2_, type_,parent_goods_id_, goods_id_,goods_name_, num_,
         user_id_,
         payment_channel_,mer_no_,batch_no_,stock_type_,account_type_,status_, refund_time_,sell_time_, create_ime_,
-        update_time_,coupon_remit_amount_
+        update_time_,coupon_remit_amount_,organ_sell_cost_
     </sql>
     <select id="get" parameterType="java.lang.Integer" resultMap="SellOrder">
         <!--@mbg.generated-->
@@ -69,13 +70,14 @@
         insert into sell_order (edu_teacher_id_,organ_id_, cooperation_organ_id_, trans_no_,order_id_, order_no_,
         expect_amount_,actual_amount_,balance_amount_, type_,parent_goods_id_, goods_id_,goods_name_, sell_cost_,
         sell_cost2_, num_, user_id_, payment_channel_,
-        mer_no_,batch_no_,stock_type_,account_type_, refund_time_,sell_time_, create_ime_, update_time_,coupon_remit_amount_,tenant_id_)
+        mer_no_,batch_no_,stock_type_,account_type_, refund_time_,sell_time_,
+        create_ime_, update_time_,coupon_remit_amount_,tenant_id_,organ_sell_cost_)
         values (#{eduTeacherId},#{organId}, #{cooperationOrganId}, #{transNo}, #{orderNo},#{orderId}, #{expectAmount},
         #{actualAmount}, #{balanceAmount}, #{type},#{parentGoodsId}, #{goodsId}, #{goodsName}, #{sellCost},
         #{sellCost2}, #{num}, #{userId},
         #{paymentChannel}, #{merNo},#{batchNo},
         #{stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{accountType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{refundTime},#{sellTime}, #{createIme}, #{updateTime}, #{couponRemitAmount},#{tenantId})
+        #{refundTime},#{sellTime}, #{createIme}, #{updateTime}, #{couponRemitAmount},#{tenantId},#{organSellCost})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.SellOrder">
         <!--@mbg.generated-->
@@ -126,6 +128,9 @@
             <if test="sellCost != null">
                 sell_cost_ = #{sellCost},
             </if>
+            <if test="organSellCost != null">
+                organ_sell_cost_ = #{organSellCost},
+            </if>
             <if test="sellCost2 != null">
                 sell_cost2_ = #{sellCost2},
             </if>
@@ -215,6 +220,9 @@
                 <if test="sellOrder.sellCost != null">
                     sell_cost_ = #{sellOrder.sellCost},
                 </if>
+                <if test="sellOrder.organSellCost != null">
+                    organ_sell_cost_ = #{sellOrder.organSellCost},
+                </if>
                 <if test="sellOrder.sellCost2 != null">
                     sell_cost2_ = #{sellOrder.sellCost2},
                 </if>
@@ -261,7 +269,7 @@
         insert into sell_order (organ_id_, cooperation_organ_id_, trans_no_,order_id_, order_no_, expect_amount_,
         actual_amount_,balance_amount_, type_, parent_goods_id_, goods_id_,goods_name_, sell_cost_, sell_cost2_, num_,
         user_id_, payment_channel_,
-        mer_no_,batch_no_,stock_type_,account_type_, sell_time_,edu_teacher_id_, create_ime_, update_time_,coupon_remit_amount_,tenant_id_)
+        mer_no_,batch_no_,stock_type_,account_type_, sell_time_,edu_teacher_id_, create_ime_, update_time_,coupon_remit_amount_,tenant_id_,organ_sell_cost_)
         VALUE
         <foreach collection="sellOrders" separator="," item="sellOrder">
             (#{sellOrder.organId},#{sellOrder.cooperationOrganId},#{sellOrder.transNo},#{sellOrder.orderId},#{sellOrder.orderNo},
@@ -269,7 +277,7 @@
             #{sellOrder.goodsName},#{sellOrder.sellCost},#{sellOrder.sellCost2},#{sellOrder.num},#{sellOrder.userId},
             #{sellOrder.paymentChannel},#{sellOrder.merNo},#{sellOrder.batchNo},
             #{sellOrder.stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{sellOrder.accountType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-            #{sellOrder.sellTime},#{sellOrder.eduTeacherId},NOW(),NOW(),#{sellOrder.couponRemitAmount},#{sellOrder.tenantId})
+            #{sellOrder.sellTime},#{sellOrder.eduTeacherId},NOW(),NOW(),#{sellOrder.couponRemitAmount},#{sellOrder.tenantId},#{sellOrder.organSellCost})
         </foreach>
     </insert>