Browse Source

王宇:LantoneProductFacade

wangyu 6 years ago
parent
commit
11068cf1f1

+ 65 - 0
diagbotman-service/src/main/java/com/diagbot/facade/LantoneProductFacade.java

@@ -0,0 +1,65 @@
+package com.diagbot.facade;
+
+import com.diagbot.entity.LantoneProduct;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.service.impl.LantoneProductServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2018/9/19 15:52
+ */
+@Component
+public class LantoneProductFacade extends LantoneProductServiceImpl{
+    /**
+     * @Description: 添加产品业务逻辑
+     * @Author: wangyu
+     * @Date: 19:59 2018/9/18
+     */
+    public CommonErrorCode addProducts(LantoneProduct lantoneProduct) {
+        LantoneProduct diagLantoneProduct1 =new LantoneProduct();
+
+        if(!save(lantoneProduct)){
+            return CommonErrorCode.FAIL;
+        }
+        return CommonErrorCode.OK;
+    }
+
+    /**
+     * @Description: 修改产品业务逻辑
+     * @Author: wangyu
+     * @Date: 19:59 2018/9/18
+     */
+    public CommonErrorCode updateProduct(LantoneProduct lantoneProduct) {
+        if(!updateById(lantoneProduct)){
+            return CommonErrorCode.FAIL;
+        }
+        return CommonErrorCode.OK;
+    }
+
+    /**
+     * @Description: 删除产品业务逻辑
+     * @Author: wangyu
+     * @Date: 19:59 2018/9/18
+     */
+    public CommonErrorCode deleteProduct(LantoneProduct lantoneProduct) {
+        lantoneProduct.setIsDeleted("Y");
+        if(!updateById(lantoneProduct)){
+            return CommonErrorCode.FAIL;
+        }
+        return CommonErrorCode.OK;
+    }
+
+    /**
+     * @Description: 更改产品状态业务逻辑
+     * @Author: wangyu
+     * @Date: 19:59 2018/9/18
+     */
+    public CommonErrorCode productStatus(LantoneProduct lantoneProduct) {
+        if(!updateById(lantoneProduct)){
+            return CommonErrorCode.FAIL;
+        }
+        return CommonErrorCode.OK;
+    }
+}