ソースを参照

心愿互换新增字段,剩余数量字段功能

yanliming 1 年間 前
コミット
41ac662ef4

+ 3 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/WishInfo.java

@@ -66,6 +66,9 @@ public class WishInfo {
 			@ApiModelProperty(value = "是否删除")
 	private Boolean delFlag;
 
+	@ApiModelProperty(value = "剩余数量")
+	private Integer remainingAmount;
+
 	@ApiModelProperty(value = "已换数量")
 	private Integer recordAmount;
 	@ApiModelProperty(value = "心愿列表")

+ 8 - 3
common/src/main/resources/mapper/base/WishInfo.xml

@@ -10,14 +10,15 @@
 			<result property="introduction" column="introduction_" />
 			<result property="image" column="image_" />
 			<result property="amount" column="amount_" />
-		<result property="studentName" column="student_name" />
-		<result property="studentType" column="student_type" />
+			<result property="studentName" column="student_name" />
+			<result property="studentType" column="student_type" />
 			<result property="status" column="status_" />
 			<result property="createBy" column="create_by" />
 			<result property="createTime" column="create_time" />
 			<result property="updateBy" column="update_by" />
 			<result property="updateTime" column="update_time" />
 			<result property="delFlag" column="del_flag" />
+			<result property="remainingAmount" column="remaining_amount" />
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.WishInfo">
 	<!--
@@ -27,7 +28,7 @@
 	-->
 	<![CDATA[
 		insert into base_wish_info
-	    (id_,category_,title_,introduction_,image_,amount_,student_name,student_type,status_,create_by,create_time,update_by,update_time,del_flag)
+	    (id_,category_,title_,introduction_,image_,amount_,student_name,student_type,status_,create_by,create_time,update_by,update_time,del_flag,remaining_amount)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -44,6 +45,7 @@
 ,#{updateBy,jdbcType=VARCHAR}
 ,#{updateTime,jdbcType= TIMESTAMP }
 ,#{delFlag,jdbcType= NUMERIC }
+,#{remainingAmount,jdbcType= NUMERIC }
 		)
 	]]>
 	</insert>
@@ -92,6 +94,9 @@
 				<if test="delFlag!=null">
 		del_flag=#{delFlag,jdbcType= NUMERIC },
 		</if>
+			<if test="remainingAmount!=null">
+				remaining_amount=#{remainingAmount,jdbcType= NUMERIC },
+			</if>
 		</set>
 	where id_=#{id}
 	</update>

+ 1 - 0
web/src/main/java/com/jpsoft/employment/modules/base/controller/WishInfoController.java

@@ -67,6 +67,7 @@ public class WishInfoController {
             wishInfo.setCreateBy(subject);
             wishInfo.setCreateTime(new Date());
             wishInfo.setStatus("1");
+            wishInfo.setRemainingAmount(wishInfo.getAmount());
 
             int affectCount = wishInfoService.insertAndAspirations(wishInfo);