Sfoglia il codice sorgente

物品出入库页面生成(待测试)

duckweed 6 anni fa
parent
commit
0240ff9393

+ 35 - 0
WebService/src/main/java/com/java110/web/components/ItemOutBindingComponent.java

@@ -0,0 +1,35 @@
+package com.java110.web.components;
+
+import com.java110.core.context.IPageData;
+import com.java110.web.smo.itemOut.IItemOutBindingSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+
+/**
+ * 添加物品出库组件
+ */
+@Component("itemOutBinding")
+public class ItemOutBindingComponent {
+
+    @Autowired
+    private IItemOutBindingSMO itemOutBindingSMOImpl;
+
+    /**
+     * 添加物品出库数据
+     *
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    public ResponseEntity<String> binding(IPageData pd) {
+        return itemOutBindingSMOImpl.bindingItemOut(pd);
+    }
+
+    public IItemOutBindingSMO getItemOutBindingSMOImpl() {
+        return itemOutBindingSMOImpl;
+    }
+
+    public void setItemOutBindingSMOImpl(IItemOutBindingSMO itemOutBindingSMOImpl) {
+        this.itemOutBindingSMOImpl = itemOutBindingSMOImpl;
+    }
+}

+ 19 - 0
WebService/src/main/java/com/java110/web/smo/itemOut/IItemOutBindingSMO.java

@@ -0,0 +1,19 @@
+package com.java110.web.smo.itemOut;
+
+import com.java110.core.context.IPageData;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 添加物品出库接口
+ *
+ * add by wuxw 2019-06-30
+ */
+public interface IItemOutBindingSMO {
+
+    /**
+     * 添加物品出库
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    ResponseEntity<String> bindingItemOut(IPageData pd);
+}

+ 64 - 0
WebService/src/main/java/com/java110/web/smo/itemOut/impl/ItemOutBindingSMOImpl.java

@@ -0,0 +1,64 @@
+package com.java110.web.smo.itemOut.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.PrivilegeCodeConstant;
+import com.java110.utils.constant.ServiceCodeItemOutConstant;
+import com.java110.utils.constant.ServiceConstant;
+import com.java110.utils.util.Assert;
+import com.java110.core.context.IPageData;
+import com.java110.web.core.AbstractComponentSMO;
+import com.java110.web.smo.itemOut.IItemOutBindingSMO;
+import org.springframework.stereotype.Service;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * 添加小区服务实现类
+ * add by wuxw 2019-06-30
+ */
+@Service("itemOutBindingSMOImpl")
+public class ItemOutBindingSMOImpl extends AbstractComponentSMO implements IItemOutBindingSMO {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Override
+    protected void validate(IPageData pd, JSONObject paramIn) {
+
+        //super.validatePageInfo(pd);
+        JSONArray infos = paramIn.getJSONArray("data");
+        //Assert.hasKeyAndValue(paramIn, "xxx", "xxx");
+        
+
+
+        super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.ITEMOUT);
+
+    }
+
+    @Override
+    protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) {
+        ResponseEntity<String> responseEntity = null;
+        super.validateStoreStaffCommunityRelationship(pd, restTemplate);
+
+        responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(),
+                ServiceConstant.SERVICE_API_URL + "/api/" + ServiceCodeItemOutConstant.BINDING_ITEMOUT,
+                HttpMethod.POST);
+        return responseEntity;
+    }
+
+    @Override
+    public ResponseEntity<String> bindingItemOut(IPageData pd) {
+        return super.businessProcess(pd);
+    }
+
+    public RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    public void setRestTemplate(RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+    }
+}

+ 41 - 0
WebService/src/main/resources/components/itemOutPackage/itemOut/itemOut.html

@@ -0,0 +1,41 @@
+<div id="component">
+
+    <div class="java110_step">
+        <div id="step"></div>
+    </div>
+
+    <!-- 选择 应用信息 -->
+    <div v-if="itemOutInfo.index == 0">
+        <vc:create name="viewItemOutInfo"
+                   callBackListener="itemOut"
+                   callBackFunction="notify"
+        ></vc:create>
+    </div>
+    <div v-if="itemOutInfo.index == 1">
+        <vc:create name="viewStaffInfo"
+                   callBackListener="itemOut"
+                   callBackFunction="notify"
+        ></vc:create>
+    </div>
+    <div v-if="itemOutInfo.index == 2">
+        <vc:create name="viewOrgInfo"
+                   callBackListener="itemOut"
+                   callBackFunction="notify"
+        ></vc:create>
+    </div>
+
+
+    <div class="row">
+        <div class="col-md-10"></div>
+        <div class="col-md-2 " style="margin-bottom:10px; text-align:right">
+            <button type="button" class="btn btn-secondary" v-on:click="_prevStep()">上一步</button>
+            <button v-if="itemOutInfo.index != 2" type="button" class="btn btn-primary" style="margin-left:10px;"
+                    v-on:click="_nextStep()">下一步
+            </button>
+            <button v-if="itemOutInfo.index == 2" type="button" class="btn btn-primary" style="margin-left:10px;"
+                    v-on:click="_finishStep()">完成
+            </button>
+        </div>
+    </div>
+
+</div>

+ 93 - 0
WebService/src/main/resources/components/itemOutPackage/itemOut/itemOut.js

@@ -0,0 +1,93 @@
+/**
+    入驻小区
+**/
+(function(vc){
+    vc.extends({
+        data:{
+            itemOutInfo:{
+                $step:{},
+                index:0,
+                infos:[]
+            }
+        },
+        _initMethod:function(){
+            vc.component._initStep();
+        },
+        _initEvent:function(){
+            vc.on("itemOut", "notify", function(_info){
+                vc.component.itemOutInfo.infos[vc.component.itemOutInfo.index] = _info;
+            });
+
+        },
+        methods:{
+            _initStep:function(){
+                vc.component.itemOutInfo.$step = $("#step");
+                vc.component.itemOutInfo.$step.step({
+                    index: 0,
+                    time: 500,
+                    title: ["选择物品","选择员工","选择员工"]
+                });
+                vc.component.itemOutInfo.index = vc.component.itemOutInfo.$step.getIndex();
+            },
+            _prevStep:function(){
+                vc.component.itemOutInfo.$step.prevStep();
+                vc.component.itemOutInfo.index = vc.component.itemOutInfo.$step.getIndex();
+
+                vc.emit('viewItemOutInfo', 'onIndex', vc.component.itemOutInfo.index);
+vc.emit('viewStaffInfo', 'onIndex', vc.component.itemOutInfo.index);
+vc.emit('viewOrgInfo', 'onIndex', vc.component.itemOutInfo.index);
+
+            },
+            _nextStep:function(){
+                var _currentData = vc.component.itemOutInfo.infos[vc.component.itemOutInfo.index];
+                if( _currentData == null || _currentData == undefined){
+                    vc.message("请选择或填写必选信息");
+                    return ;
+                }
+                vc.component.itemOutInfo.$step.nextStep();
+                vc.component.itemOutInfo.index = vc.component.itemOutInfo.$step.getIndex();
+
+                 vc.emit('viewItemOutInfo', 'onIndex', vc.component.itemOutInfo.index);
+vc.emit('viewStaffInfo', 'onIndex', vc.component.itemOutInfo.index);
+vc.emit('viewOrgInfo', 'onIndex', vc.component.itemOutInfo.index);
+
+            },
+            _finishStep:function(){
+
+
+                var _currentData = vc.component.itemOutInfo.infos[vc.component.itemOutInfo.index];
+                if( _currentData == null || _currentData == undefined){
+                    vc.message("请选择或填写必选信息");
+                    return ;
+                }
+
+                var param = {
+                    data:vc.component.itemOutInfo.infos
+                }
+
+               vc.http.post(
+                   'itemOutBinding',
+                   'binding',
+                   JSON.stringify(param),
+                   {
+                       emulateJSON:true
+                    },
+                    function(json,res){
+                       if(res.status == 200){
+
+                           vc.message('处理成功',true);
+                           //关闭model
+                           vc.jumpToPage("/flow/itemOut?" + vc.objToGetParam(JSON.parse(json)));
+                           return ;
+                       }
+                       vc.message(json);
+                    },
+                    function(errInfo,error){
+                       console.log('请求失败处理');
+
+                       vc.message(errInfo);
+                    });
+            }
+        }
+    });
+})(window.vc);

+ 38 - 0
WebService/src/main/resources/views/itemOutFlow.html

@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html lang="en"
+      xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:th="http://www.thymeleaf.org"
+      xmlns:vc="http://www.thymeleaf.org">
+<head>
+    <meta charset="UTF-8"/>
+    <title>物品出库|java110</title>
+    <vc:create name="commonTop"></vc:create>
+    <link href="/css/jquery.step.css" rel="stylesheet"/>
+    <script src="/js/jquery.step.min.js"></script>
+</head>
+<body>
+<vc:create name="bodyTop"></vc:create>
+<div id="wrapper">
+    <vc:create name="menu"></vc:create>
+
+
+    <div id="page-wrapper" class="gray-bg dashbard-1">
+        <div class="row border-bottom">
+            <vc:create name="nav"></vc:create>
+        </div>
+        <div class="wrapper wrapper-content" style="padding-bottom: 0px;">
+            <vc:create name="breadcrumb"></vc:create>
+        </div>
+        <!-- id="component" -->
+        <div class="wrapper wrapper-content animated fadeInRight">
+            <vc:create name="itemOut"></vc:create>
+        </div>
+
+        <vc:create name="copyright"></vc:create>
+
+    </div>
+</div>
+
+<vc:create name="commonBottom"></vc:create>
+</body>
+</html>

+ 1 - 1
java110-utils/src/main/java/com/java110/utils/constant/PrivilegeCodeConstant.java

@@ -113,6 +113,6 @@ public final class PrivilegeCodeConstant {
     public static final String AGENT_HAS_LIST_RESOURCESTORE = "502019102151130004";
     public static final String AGENT_HAS_LIST_RESOURCESTORE = "502019102151130004";
 
 
 
 
-
+    public static final String ITEMOUT="5020191023000001";
 
 
 }
 }

+ 16 - 0
java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeItemOutConstant.java

@@ -0,0 +1,16 @@
+package com.java110.utils.constant;
+
+/**
+ * 物品出库常量类
+ * Created by wuxw on 2017/5/20.
+ */
+public class ServiceCodeItemOutConstant {
+
+    /**
+     * 添加 物品出库
+     */
+    public static final String BINDING_ITEMOUT = "itemOut.itemOut";
+
+
+
+}