|
@@ -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;
|
|
|
+ }
|
|
|
+}
|