Browse Source

增加修改时间接口

zhangyang 2 năm trước cách đây
mục cha
commit
f6bc8cc538

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/PoTetherController.java

@@ -10,6 +10,7 @@ import com.ruoyi.system.domain.PoCollection;
 import com.ruoyi.system.domain.vo.TetherVo;
 import com.ruoyi.system.service.IPoUserService;
 import io.swagger.annotations.ApiOperation;
+import net.sf.jsqlparser.util.validation.metadata.DatabaseException;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
@@ -285,7 +286,17 @@ public class PoTetherController extends BaseController
         return toAjax(poTetherService.updatePoTetherIsGrounding(grounding,tetherId));
     }
 
+/**
+ * 修改时间
+ */
+@ApiOperation("修改时间")
+@PreAuthorize("@ss.hasPermi('system:tether:updateTime')")
+@PutMapping("/updateTime")
+public AjaxResult updateTime(@RequestBody PoTether poTether){
 
+    poTetherService.updateTime(poTether);
+    return AjaxResult.success("修改时间成功");
+}
 
 }
 

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/PoTetherMapper.java

@@ -159,4 +159,6 @@ public interface PoTetherMapper extends BaseMapper<PoTether>
     void updateShowTimeEnd(TetherVo tetherVo);
 
     Integer updateSellStatus();
+
+    void updateTime(PoTether poTether);
 }

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IPoTetherService.java

@@ -144,5 +144,7 @@ public interface IPoTetherService extends IService<PoTether>
      */
     void updateShowTimeEnd(TetherVo tetherVo);
 
+
+    void updateTime(PoTether poTether);
 }
 

+ 5 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/PoTetherServiceImpl.java

@@ -349,5 +349,10 @@ public class PoTetherServiceImpl extends ServiceImpl<PoTetherMapper,PoTether> im
         poTetherMapper.updateShowTimeEnd(tetherVo);
     }
 
+    @Override
+    public void updateTime(PoTether poTether) {
+         poTetherMapper.updateTime(poTether);
+    }
+
 }
 

+ 12 - 0
ruoyi-system/src/main/resources/mapper/system/PoTetherMapper.xml

@@ -311,5 +311,17 @@
                  when now() > show_time_start and show_time_end > now() then 0
                  END;
     </update>
+
+    <update id="updateTime" parameterType="PoTether">
+        update po_tether
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="showTimeStart != null">show_time_start = #{showTimeStart},</if>
+            <if test="showTimeEnd != null">show_time_end = #{showTimeEnd},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where tether_id = #{tetherId}
+    </update>
+
 </mapper>