'提交代码'

dev-discount
199901012 4 years ago
parent ace727f752
commit 13c5039821
  1. 4
      hai-bweb/src/main/java/com/bweb/controller/HighGoodsPriceReferController.java
  2. 37
      hai-service/src/main/java/com/hai/dao/HighGoodsPriceReferMapper.java
  3. 14
      hai-service/src/main/java/com/hai/dao/HighGoodsPriceReferSqlProvider.java
  4. 16
      hai-service/src/main/java/com/hai/entity/HighGoodsPriceRefer.java
  5. 60
      hai-service/src/main/java/com/hai/entity/HighGoodsPriceReferExample.java
  6. 2
      hai-service/src/main/java/com/hai/service/HighGoodsPriceReferService.java
  7. 8
      hai-service/src/main/java/com/hai/service/impl/HighGoodsPriceReferServiceImpl.java

@ -122,6 +122,7 @@ public class HighGoodsPriceReferController {
// 卡卷原价 * (折扣 ÷ 10) // 卡卷原价 * (折扣 ÷ 10)
BigDecimal newSalePrice = coupon.getSalesPrice().multiply(new BigDecimal(addGoodsPriceModel.getDiscountNum().toString()).divide(new BigDecimal("10"))); BigDecimal newSalePrice = coupon.getSalesPrice().multiply(new BigDecimal(addGoodsPriceModel.getDiscountNum().toString()).divide(new BigDecimal("10")));
highGoodsPriceRefer.setNewSalePrice(newSalePrice); highGoodsPriceRefer.setNewSalePrice(newSalePrice);
highGoodsPriceRefer.setDiscountNum(addGoodsPriceModel.getDiscountNum());
} }
highGoodsPriceRefer.setCreateTime(new Date()); highGoodsPriceRefer.setCreateTime(new Date());
highGoodsPriceRefer.setStatus(101); // 状态: 0:删除 1:待编辑 2:待生效 3:已生效 4:已失效 101.审批中 102.审批驳回 highGoodsPriceRefer.setStatus(101); // 状态: 0:删除 1:待编辑 2:待生效 3:已生效 4:已失效 101.审批中 102.审批驳回
@ -131,8 +132,7 @@ public class HighGoodsPriceReferController {
} }
} }
highGoodsPriceReferService.submitApproveList(list);
highGoodsPriceReferService.submitApprove(null);
return ResponseMsgUtil.success("操作成功"); return ResponseMsgUtil.success("操作成功");
} catch (Exception e) { } catch (Exception e) {

@ -40,21 +40,21 @@ public interface HighGoodsPriceReferMapper extends HighGoodsPriceReferMapperExt
@Insert({ @Insert({
"insert into high_goods_price_refer (object_type, object_id, ", "insert into high_goods_price_refer (object_type, object_id, ",
"price_type, old_sale_price, ", "price_type, discount_num, ",
"new_sale_price, promptly_type, ", "old_sale_price, new_sale_price, ",
"effective_time, invalid_time, ", "promptly_type, effective_time, ",
"remark, create_time, ", "invalid_time, remark, ",
"operator_id, operator_name, ", "create_time, operator_id, ",
"`status`, ext_1, ext_2, ", "operator_name, `status`, ",
"ext_3)", "ext_1, ext_2, ext_3)",
"values (#{objectType,jdbcType=INTEGER}, #{objectId,jdbcType=BIGINT}, ", "values (#{objectType,jdbcType=INTEGER}, #{objectId,jdbcType=BIGINT}, ",
"#{priceType,jdbcType=INTEGER}, #{oldSalePrice,jdbcType=DECIMAL}, ", "#{priceType,jdbcType=INTEGER}, #{discountNum,jdbcType=DECIMAL}, ",
"#{newSalePrice,jdbcType=DECIMAL}, #{promptlyType,jdbcType=BIT}, ", "#{oldSalePrice,jdbcType=DECIMAL}, #{newSalePrice,jdbcType=DECIMAL}, ",
"#{effectiveTime,jdbcType=TIMESTAMP}, #{invalidTime,jdbcType=TIMESTAMP}, ", "#{promptlyType,jdbcType=BIT}, #{effectiveTime,jdbcType=TIMESTAMP}, ",
"#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", "#{invalidTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, ",
"#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ", "#{createTime,jdbcType=TIMESTAMP}, #{operatorId,jdbcType=BIGINT}, ",
"#{status,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ", "#{operatorName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{ext3,jdbcType=VARCHAR})" "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
}) })
@Options(useGeneratedKeys=true,keyProperty="id") @Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighGoodsPriceRefer record); int insert(HighGoodsPriceRefer record);
@ -69,6 +69,7 @@ public interface HighGoodsPriceReferMapper extends HighGoodsPriceReferMapperExt
@Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER), @Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT),
@Result(column="price_type", property="priceType", jdbcType=JdbcType.INTEGER), @Result(column="price_type", property="priceType", jdbcType=JdbcType.INTEGER),
@Result(column="discount_num", property="discountNum", jdbcType=JdbcType.DECIMAL),
@Result(column="old_sale_price", property="oldSalePrice", jdbcType=JdbcType.DECIMAL), @Result(column="old_sale_price", property="oldSalePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="new_sale_price", property="newSalePrice", jdbcType=JdbcType.DECIMAL), @Result(column="new_sale_price", property="newSalePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="promptly_type", property="promptlyType", jdbcType=JdbcType.BIT), @Result(column="promptly_type", property="promptlyType", jdbcType=JdbcType.BIT),
@ -87,9 +88,9 @@ public interface HighGoodsPriceReferMapper extends HighGoodsPriceReferMapperExt
@Select({ @Select({
"select", "select",
"id, object_type, object_id, price_type, old_sale_price, new_sale_price, promptly_type, ", "id, object_type, object_id, price_type, discount_num, old_sale_price, new_sale_price, ",
"effective_time, invalid_time, remark, create_time, operator_id, operator_name, ", "promptly_type, effective_time, invalid_time, remark, create_time, operator_id, ",
"`status`, ext_1, ext_2, ext_3", "operator_name, `status`, ext_1, ext_2, ext_3",
"from high_goods_price_refer", "from high_goods_price_refer",
"where id = #{id,jdbcType=BIGINT}" "where id = #{id,jdbcType=BIGINT}"
}) })
@ -98,6 +99,7 @@ public interface HighGoodsPriceReferMapper extends HighGoodsPriceReferMapperExt
@Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER), @Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER),
@Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT),
@Result(column="price_type", property="priceType", jdbcType=JdbcType.INTEGER), @Result(column="price_type", property="priceType", jdbcType=JdbcType.INTEGER),
@Result(column="discount_num", property="discountNum", jdbcType=JdbcType.DECIMAL),
@Result(column="old_sale_price", property="oldSalePrice", jdbcType=JdbcType.DECIMAL), @Result(column="old_sale_price", property="oldSalePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="new_sale_price", property="newSalePrice", jdbcType=JdbcType.DECIMAL), @Result(column="new_sale_price", property="newSalePrice", jdbcType=JdbcType.DECIMAL),
@Result(column="promptly_type", property="promptlyType", jdbcType=JdbcType.BIT), @Result(column="promptly_type", property="promptlyType", jdbcType=JdbcType.BIT),
@ -128,6 +130,7 @@ public interface HighGoodsPriceReferMapper extends HighGoodsPriceReferMapperExt
"set object_type = #{objectType,jdbcType=INTEGER},", "set object_type = #{objectType,jdbcType=INTEGER},",
"object_id = #{objectId,jdbcType=BIGINT},", "object_id = #{objectId,jdbcType=BIGINT},",
"price_type = #{priceType,jdbcType=INTEGER},", "price_type = #{priceType,jdbcType=INTEGER},",
"discount_num = #{discountNum,jdbcType=DECIMAL},",
"old_sale_price = #{oldSalePrice,jdbcType=DECIMAL},", "old_sale_price = #{oldSalePrice,jdbcType=DECIMAL},",
"new_sale_price = #{newSalePrice,jdbcType=DECIMAL},", "new_sale_price = #{newSalePrice,jdbcType=DECIMAL},",
"promptly_type = #{promptlyType,jdbcType=BIT},", "promptly_type = #{promptlyType,jdbcType=BIT},",

@ -40,6 +40,10 @@ public class HighGoodsPriceReferSqlProvider {
sql.VALUES("price_type", "#{priceType,jdbcType=INTEGER}"); sql.VALUES("price_type", "#{priceType,jdbcType=INTEGER}");
} }
if (record.getDiscountNum() != null) {
sql.VALUES("discount_num", "#{discountNum,jdbcType=DECIMAL}");
}
if (record.getOldSalePrice() != null) { if (record.getOldSalePrice() != null) {
sql.VALUES("old_sale_price", "#{oldSalePrice,jdbcType=DECIMAL}"); sql.VALUES("old_sale_price", "#{oldSalePrice,jdbcType=DECIMAL}");
} }
@ -105,6 +109,7 @@ public class HighGoodsPriceReferSqlProvider {
sql.SELECT("object_type"); sql.SELECT("object_type");
sql.SELECT("object_id"); sql.SELECT("object_id");
sql.SELECT("price_type"); sql.SELECT("price_type");
sql.SELECT("discount_num");
sql.SELECT("old_sale_price"); sql.SELECT("old_sale_price");
sql.SELECT("new_sale_price"); sql.SELECT("new_sale_price");
sql.SELECT("promptly_type"); sql.SELECT("promptly_type");
@ -151,6 +156,10 @@ public class HighGoodsPriceReferSqlProvider {
sql.SET("price_type = #{record.priceType,jdbcType=INTEGER}"); sql.SET("price_type = #{record.priceType,jdbcType=INTEGER}");
} }
if (record.getDiscountNum() != null) {
sql.SET("discount_num = #{record.discountNum,jdbcType=DECIMAL}");
}
if (record.getOldSalePrice() != null) { if (record.getOldSalePrice() != null) {
sql.SET("old_sale_price = #{record.oldSalePrice,jdbcType=DECIMAL}"); sql.SET("old_sale_price = #{record.oldSalePrice,jdbcType=DECIMAL}");
} }
@ -215,6 +224,7 @@ public class HighGoodsPriceReferSqlProvider {
sql.SET("object_type = #{record.objectType,jdbcType=INTEGER}"); sql.SET("object_type = #{record.objectType,jdbcType=INTEGER}");
sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}"); sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}");
sql.SET("price_type = #{record.priceType,jdbcType=INTEGER}"); sql.SET("price_type = #{record.priceType,jdbcType=INTEGER}");
sql.SET("discount_num = #{record.discountNum,jdbcType=DECIMAL}");
sql.SET("old_sale_price = #{record.oldSalePrice,jdbcType=DECIMAL}"); sql.SET("old_sale_price = #{record.oldSalePrice,jdbcType=DECIMAL}");
sql.SET("new_sale_price = #{record.newSalePrice,jdbcType=DECIMAL}"); sql.SET("new_sale_price = #{record.newSalePrice,jdbcType=DECIMAL}");
sql.SET("promptly_type = #{record.promptlyType,jdbcType=BIT}"); sql.SET("promptly_type = #{record.promptlyType,jdbcType=BIT}");
@ -250,6 +260,10 @@ public class HighGoodsPriceReferSqlProvider {
sql.SET("price_type = #{priceType,jdbcType=INTEGER}"); sql.SET("price_type = #{priceType,jdbcType=INTEGER}");
} }
if (record.getDiscountNum() != null) {
sql.SET("discount_num = #{discountNum,jdbcType=DECIMAL}");
}
if (record.getOldSalePrice() != null) { if (record.getOldSalePrice() != null) {
sql.SET("old_sale_price = #{oldSalePrice,jdbcType=DECIMAL}"); sql.SET("old_sale_price = #{oldSalePrice,jdbcType=DECIMAL}");
} }

@ -34,6 +34,11 @@ public class HighGoodsPriceRefer implements Serializable {
*/ */
private Integer priceType; private Integer priceType;
/**
* 折扣数
*/
private BigDecimal discountNum;
/** /**
* 旧销售价格 * 旧销售价格
*/ */
@ -124,6 +129,14 @@ public class HighGoodsPriceRefer implements Serializable {
this.priceType = priceType; this.priceType = priceType;
} }
public BigDecimal getDiscountNum() {
return discountNum;
}
public void setDiscountNum(BigDecimal discountNum) {
this.discountNum = discountNum;
}
public BigDecimal getOldSalePrice() { public BigDecimal getOldSalePrice() {
return oldSalePrice; return oldSalePrice;
} }
@ -244,6 +257,7 @@ public class HighGoodsPriceRefer implements Serializable {
&& (this.getObjectType() == null ? other.getObjectType() == null : this.getObjectType().equals(other.getObjectType())) && (this.getObjectType() == null ? other.getObjectType() == null : this.getObjectType().equals(other.getObjectType()))
&& (this.getObjectId() == null ? other.getObjectId() == null : this.getObjectId().equals(other.getObjectId())) && (this.getObjectId() == null ? other.getObjectId() == null : this.getObjectId().equals(other.getObjectId()))
&& (this.getPriceType() == null ? other.getPriceType() == null : this.getPriceType().equals(other.getPriceType())) && (this.getPriceType() == null ? other.getPriceType() == null : this.getPriceType().equals(other.getPriceType()))
&& (this.getDiscountNum() == null ? other.getDiscountNum() == null : this.getDiscountNum().equals(other.getDiscountNum()))
&& (this.getOldSalePrice() == null ? other.getOldSalePrice() == null : this.getOldSalePrice().equals(other.getOldSalePrice())) && (this.getOldSalePrice() == null ? other.getOldSalePrice() == null : this.getOldSalePrice().equals(other.getOldSalePrice()))
&& (this.getNewSalePrice() == null ? other.getNewSalePrice() == null : this.getNewSalePrice().equals(other.getNewSalePrice())) && (this.getNewSalePrice() == null ? other.getNewSalePrice() == null : this.getNewSalePrice().equals(other.getNewSalePrice()))
&& (this.getPromptlyType() == null ? other.getPromptlyType() == null : this.getPromptlyType().equals(other.getPromptlyType())) && (this.getPromptlyType() == null ? other.getPromptlyType() == null : this.getPromptlyType().equals(other.getPromptlyType()))
@ -267,6 +281,7 @@ public class HighGoodsPriceRefer implements Serializable {
result = prime * result + ((getObjectType() == null) ? 0 : getObjectType().hashCode()); result = prime * result + ((getObjectType() == null) ? 0 : getObjectType().hashCode());
result = prime * result + ((getObjectId() == null) ? 0 : getObjectId().hashCode()); result = prime * result + ((getObjectId() == null) ? 0 : getObjectId().hashCode());
result = prime * result + ((getPriceType() == null) ? 0 : getPriceType().hashCode()); result = prime * result + ((getPriceType() == null) ? 0 : getPriceType().hashCode());
result = prime * result + ((getDiscountNum() == null) ? 0 : getDiscountNum().hashCode());
result = prime * result + ((getOldSalePrice() == null) ? 0 : getOldSalePrice().hashCode()); result = prime * result + ((getOldSalePrice() == null) ? 0 : getOldSalePrice().hashCode());
result = prime * result + ((getNewSalePrice() == null) ? 0 : getNewSalePrice().hashCode()); result = prime * result + ((getNewSalePrice() == null) ? 0 : getNewSalePrice().hashCode());
result = prime * result + ((getPromptlyType() == null) ? 0 : getPromptlyType().hashCode()); result = prime * result + ((getPromptlyType() == null) ? 0 : getPromptlyType().hashCode());
@ -293,6 +308,7 @@ public class HighGoodsPriceRefer implements Serializable {
sb.append(", objectType=").append(objectType); sb.append(", objectType=").append(objectType);
sb.append(", objectId=").append(objectId); sb.append(", objectId=").append(objectId);
sb.append(", priceType=").append(priceType); sb.append(", priceType=").append(priceType);
sb.append(", discountNum=").append(discountNum);
sb.append(", oldSalePrice=").append(oldSalePrice); sb.append(", oldSalePrice=").append(oldSalePrice);
sb.append(", newSalePrice=").append(newSalePrice); sb.append(", newSalePrice=").append(newSalePrice);
sb.append(", promptlyType=").append(promptlyType); sb.append(", promptlyType=").append(promptlyType);

@ -366,6 +366,66 @@ public class HighGoodsPriceReferExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDiscountNumIsNull() {
addCriterion("discount_num is null");
return (Criteria) this;
}
public Criteria andDiscountNumIsNotNull() {
addCriterion("discount_num is not null");
return (Criteria) this;
}
public Criteria andDiscountNumEqualTo(BigDecimal value) {
addCriterion("discount_num =", value, "discountNum");
return (Criteria) this;
}
public Criteria andDiscountNumNotEqualTo(BigDecimal value) {
addCriterion("discount_num <>", value, "discountNum");
return (Criteria) this;
}
public Criteria andDiscountNumGreaterThan(BigDecimal value) {
addCriterion("discount_num >", value, "discountNum");
return (Criteria) this;
}
public Criteria andDiscountNumGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("discount_num >=", value, "discountNum");
return (Criteria) this;
}
public Criteria andDiscountNumLessThan(BigDecimal value) {
addCriterion("discount_num <", value, "discountNum");
return (Criteria) this;
}
public Criteria andDiscountNumLessThanOrEqualTo(BigDecimal value) {
addCriterion("discount_num <=", value, "discountNum");
return (Criteria) this;
}
public Criteria andDiscountNumIn(List<BigDecimal> values) {
addCriterion("discount_num in", values, "discountNum");
return (Criteria) this;
}
public Criteria andDiscountNumNotIn(List<BigDecimal> values) {
addCriterion("discount_num not in", values, "discountNum");
return (Criteria) this;
}
public Criteria andDiscountNumBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount_num between", value1, value2, "discountNum");
return (Criteria) this;
}
public Criteria andDiscountNumNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("discount_num not between", value1, value2, "discountNum");
return (Criteria) this;
}
public Criteria andOldSalePriceIsNull() { public Criteria andOldSalePriceIsNull() {
addCriterion("old_sale_price is null"); addCriterion("old_sale_price is null");
return (Criteria) this; return (Criteria) this;

@ -37,6 +37,8 @@ public interface HighGoodsPriceReferService {
**/ **/
void submitApprove(HighGoodsPriceRefer highGoodsPriceRefer) throws Exception; void submitApprove(HighGoodsPriceRefer highGoodsPriceRefer) throws Exception;
void submitApproveList(List<HighGoodsPriceRefer> highGoodsPriceReferList) throws Exception;
/** /**
* @Author 胡锐 * @Author 胡锐
* @Description 根据id查询 * @Description 根据id查询

@ -63,6 +63,14 @@ public class HighGoodsPriceReferServiceImpl implements HighGoodsPriceReferServic
highApproveService.insertApprove(approve); highApproveService.insertApprove(approve);
} }
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void submitApproveList(List<HighGoodsPriceRefer> highGoodsPriceReferList) throws Exception {
for (HighGoodsPriceRefer highGoodsPriceRefer : highGoodsPriceReferList) {
submitApprove(highGoodsPriceRefer);
}
}
@Override @Override
public HighGoodsPriceRefer getPriceReferById(Long id) { public HighGoodsPriceRefer getPriceReferById(Long id) {

Loading…
Cancel
Save