diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index e9ee0b7..8c78085 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,18 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="ChangeListManager">
-    <list default="true" id="908d8a6f-e3e4-4fdc-b674-e523a3e2b520" name="Default Changelist" comment="">
+    <list default="true" id="1fe4ff20-6474-45ee-a361-9572a808e9c9" name="Default Changelist" comment="Merge branch 'develop' of http://172.16.29.40:8010/wms/wms2 into develop&#10;&#10;# Conflicts:&#10;#&#9;.idea/workspace.xml&#10;#&#9;src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderService.java&#10;#&#9;src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/controller/CycleCountHeaderController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/controller/CycleCountHeaderController.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderServiceImpl.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/resources/templates/inventory/adjustDetail/addAdjust.html" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/templates/inventory/adjustHeader/addAdjust.html" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/resources/templates/inventory/adjustDetail/adjustDetail.html" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/templates/inventory/adjustDetail/adjustDetail.html" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/resources/templates/inventory/adjustDetail/adjustEdit.html" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/templates/inventory/adjustHeader/adjustEdit.html" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/resources/templates/inventory/adjustHeader/adjustHeader.html" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/templates/inventory/adjustHeader/adjustHeader.html" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/resources/templates/inventory/cycleCountDetail/cycleCountDetail.html" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/templates/inventory/cycleCountDetail/cycleCountDetail.html" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/resources/templates/inventory/cycleCountHeader/cycleCountHeader.html" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/templates/inventory/cycleCountHeader/cycleCountHeader.html" afterDir="false" />
     </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
     <option name="SHOW_DIALOG" value="false" />
@@ -47,45 +38,91 @@
         <item name="schemas" type="d4e8921:DatabaseStructure$FamilyGroup" />
         <item name="wms_v2: schema" type="76f4a085:MysqlImplModel$Schema" />
       </path>
+      <path>
+        <item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
+        <item name="@172.16.29.45" type="feb32156:DbDataSourceImpl" />
+        <item name="schemas" type="d4e8921:DatabaseStructure$FamilyGroup" />
+        <item name="wms_v2: schema" type="76f4a085:MysqlImplModel$Schema" />
+        <item name="task_detail: table" type="285a2a93:MysqlImplModel$Table" />
+      </path>
+      <path>
+        <item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
+        <item name="@localhost" type="feb32156:DbDataSourceImpl" />
+      </path>
+      <path>
+        <item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
+        <item name="@localhost" type="feb32156:DbDataSourceImpl" />
+        <item name="schemas" type="d4e8921:DatabaseStructure$FamilyGroup" />
+      </path>
     </expand>
     <select />
   </component>
   <component name="FileEditorManager">
     <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
       <file pinned="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/controller/CycleCountHeaderController.java">
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/controller/TaskHeaderController.java">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="542">
+              <caret line="117" column="45" lean-forward="true" selection-start-line="117" selection-start-column="45" selection-end-line="117" selection-end-column="45" />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderService.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="-567">
-              <caret line="44" column="51" selection-start-line="44" selection-start-column="51" selection-end-line="44" selection-end-column="51" />
+            <state relative-caret-position="209">
+              <caret line="18" column="15" selection-start-line="18" selection-start-column="15" selection-end-line="18" selection-end-column="15" />
             </state>
           </provider>
         </entry>
       </file>
       <file pinned="false" current-in-tab="true">
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java">
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="8">
-              <caret line="64" column="52" lean-forward="true" selection-start-line="64" selection-start-column="52" selection-end-line="64" selection-end-column="52" />
+            <state relative-caret-position="376">
+              <caret line="1089" column="13" lean-forward="true" selection-start-line="1089" selection-start-column="13" selection-end-line="1089" selection-end-column="13" />
+              <folding>
+                <element signature="imports" expanded="true" />
+              </folding>
             </state>
           </provider>
         </entry>
       </file>
       <file pinned="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/src/main/resources/templates/inventory/cycleCountHeader/cycleCountHeader.html">
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderService.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="-12">
-              <caret line="273" column="18" selection-start-line="273" selection-start-column="18" selection-end-line="273" selection-end-column="18" />
+            <state relative-caret-position="266">
+              <caret line="18" column="15" selection-start-line="18" selection-start-column="15" selection-end-line="18" selection-end-column="15" />
             </state>
           </provider>
         </entry>
       </file>
       <file pinned="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/src/main/resources/templates/inventory/cycleCountDetail/cycleCountDetail.html">
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="-87">
-              <caret line="122" selection-start-line="122" selection-end-line="122" />
+            <state relative-caret-position="340">
+              <caret line="112" column="26" selection-start-line="112" selection-start-column="16" selection-end-line="112" selection-end-column="26" />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryTransaction/domain/InventoryTransaction.java">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="226">
+              <caret line="95" column="19" selection-start-line="95" selection-start-column="12" selection-end-line="95" selection-end-column="19" />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/src/main/resources/templates/task/taskHeader/taskHeader.html">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="214">
+              <caret line="236" column="64" selection-start-line="236" selection-start-column="64" selection-end-line="236" selection-end-column="64" />
               <folding>
-                <element signature="e#6120#12518#0" />
+                <element signature="n#style#0;n#i#0;n#a#0;n#!!top" expanded="true" />
               </folding>
             </state>
           </provider>
@@ -113,41 +150,10 @@
   <component name="IdeDocumentHistory">
     <option name="CHANGED_PATHS">
       <list>
-        <option value="$PROJECT_DIR$/src/main/resources/templates/inventory/inventoryHeader/transfer.html" />
-        <option value="$PROJECT_DIR$/src/main/resources/application-druid.properties" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryHeader/mapper/InventoryHeaderMapper.java" />
-        <option value="$PROJECT_DIR$/src/main/resources/mybatis/inventory/InventoryHeaderMapper.xml" />
+        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java" />
+        <option value="$PROJECT_DIR$/src/main/resources/templates/task/taskHeader/taskHeader.html" />
         <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskDetail/domain/TaskDetail.java" />
-        <option value="$PROJECT_DIR$/src/main/resources/mybatis/task/TaskDetailMapper.xml" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/domain/TaskHeader.java" />
-        <option value="$PROJECT_DIR$/src/main/resources/mybatis/task/TaskHeaderMapper.xml" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryTransaction/domain/InventoryTransaction.java" />
-        <option value="$PROJECT_DIR$/src/main/resources/mybatis/inventory/InventoryTransactionMapper.xml" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/controller/TaskHeaderController.java" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/containerType/service/ContainerTypeServiceImpl.java" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderService.java" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailService.java" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryHeader/controller/InventoryHeaderController.java" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java" />
-        <option value="$PROJECT_DIR$/src/main/resources/templates/inventory/inventoryDetail/inventoryDetail.html" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryDetail/controller/InventoryDetailController.java" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderService.java" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/container/service/ContainerService.java" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/location/service/LocationService.java" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/container/service/ContainerServiceImpl.java" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/location/service/LocationServiceImpl.java" />
-        <option value="$PROJECT_DIR$/src/main/resources/mybatis/config/LocationMapper.xml" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/container/mapper/ContainerMapper.java" />
-        <option value="$PROJECT_DIR$/src/main/resources/mybatis/config/ContainerMapper.xml" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/location/mapper/LocationMapper.java" />
         <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderServiceImpl.java" />
-        <option value="$PROJECT_DIR$/src/main/resources/templates/inventory/cycleCountHeader/cycleCountHeader.html" />
-        <option value="$PROJECT_DIR$/src/main/resources/templates/inventory/cycleCountDetail/cycleCountDetail.html" />
-        <option value="$PROJECT_DIR$/src/main/resources/templates/inventory/adjustHeader/adjustHeader.html" />
-        <option value="$PROJECT_DIR$/src/main/resources/templates/inventory/adjustDetail/adjustDetail.html" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/controller/CycleCountHeaderController.java" />
-        <option value="$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java" />
       </list>
     </option>
   </component>
@@ -165,10 +171,9 @@
     </option>
   </component>
   <component name="ProjectFrameBounds" extendedState="6">
-    <option name="x" value="-9" />
-    <option name="y" value="-9" />
-    <option name="width" value="1938" />
-    <option name="height" value="1048" />
+    <option name="x" value="470" />
+    <option name="width" value="980" />
+    <option name="height" value="1030" />
   </component>
   <component name="ProjectId" id="1Q2nhRM7LRz3yFWhpclOKgTjxn0" />
   <component name="ProjectLevelVcsManager">
@@ -179,6 +184,8 @@
       <foldersAlwaysOnTop value="true" />
     </navigator>
     <panes>
+      <pane id="PackagesPane" />
+      <pane id="Scope" />
       <pane id="ProjectPane">
         <subPane>
           <expand>
@@ -189,11 +196,6 @@
             <path>
               <item name="wms2" type="b2602c69:ProjectViewProjectNode" />
               <item name="wms2" type="462c0819:PsiDirectoryNode" />
-              <item name=".idea" type="462c0819:PsiDirectoryNode" />
-            </path>
-            <path>
-              <item name="wms2" type="b2602c69:ProjectViewProjectNode" />
-              <item name="wms2" type="462c0819:PsiDirectoryNode" />
               <item name="src" type="462c0819:PsiDirectoryNode" />
             </path>
             <path>
@@ -245,7 +247,7 @@
               <item name="com" type="462c0819:PsiDirectoryNode" />
               <item name="huaheng" type="462c0819:PsiDirectoryNode" />
               <item name="pc" type="462c0819:PsiDirectoryNode" />
-              <item name="inventory" type="462c0819:PsiDirectoryNode" />
+              <item name="receipt" type="462c0819:PsiDirectoryNode" />
             </path>
             <path>
               <item name="wms2" type="b2602c69:ProjectViewProjectNode" />
@@ -256,8 +258,8 @@
               <item name="com" type="462c0819:PsiDirectoryNode" />
               <item name="huaheng" type="462c0819:PsiDirectoryNode" />
               <item name="pc" type="462c0819:PsiDirectoryNode" />
-              <item name="inventory" type="462c0819:PsiDirectoryNode" />
-              <item name="cycleCountDetail" type="462c0819:PsiDirectoryNode" />
+              <item name="receipt" type="462c0819:PsiDirectoryNode" />
+              <item name="receiptContainerHeader" type="462c0819:PsiDirectoryNode" />
             </path>
             <path>
               <item name="wms2" type="b2602c69:ProjectViewProjectNode" />
@@ -268,8 +270,8 @@
               <item name="com" type="462c0819:PsiDirectoryNode" />
               <item name="huaheng" type="462c0819:PsiDirectoryNode" />
               <item name="pc" type="462c0819:PsiDirectoryNode" />
-              <item name="inventory" type="462c0819:PsiDirectoryNode" />
-              <item name="cycleCountDetail" type="462c0819:PsiDirectoryNode" />
+              <item name="receipt" type="462c0819:PsiDirectoryNode" />
+              <item name="receiptContainerHeader" type="462c0819:PsiDirectoryNode" />
               <item name="controller" type="462c0819:PsiDirectoryNode" />
             </path>
             <path>
@@ -281,8 +283,7 @@
               <item name="com" type="462c0819:PsiDirectoryNode" />
               <item name="huaheng" type="462c0819:PsiDirectoryNode" />
               <item name="pc" type="462c0819:PsiDirectoryNode" />
-              <item name="inventory" type="462c0819:PsiDirectoryNode" />
-              <item name="cycleCountHeader" type="462c0819:PsiDirectoryNode" />
+              <item name="task" type="462c0819:PsiDirectoryNode" />
             </path>
             <path>
               <item name="wms2" type="b2602c69:ProjectViewProjectNode" />
@@ -293,9 +294,8 @@
               <item name="com" type="462c0819:PsiDirectoryNode" />
               <item name="huaheng" type="462c0819:PsiDirectoryNode" />
               <item name="pc" type="462c0819:PsiDirectoryNode" />
-              <item name="inventory" type="462c0819:PsiDirectoryNode" />
-              <item name="cycleCountHeader" type="462c0819:PsiDirectoryNode" />
-              <item name="controller" type="462c0819:PsiDirectoryNode" />
+              <item name="task" type="462c0819:PsiDirectoryNode" />
+              <item name="taskDetail" type="462c0819:PsiDirectoryNode" />
             </path>
             <path>
               <item name="wms2" type="b2602c69:ProjectViewProjectNode" />
@@ -307,6 +307,8 @@
               <item name="huaheng" type="462c0819:PsiDirectoryNode" />
               <item name="pc" type="462c0819:PsiDirectoryNode" />
               <item name="task" type="462c0819:PsiDirectoryNode" />
+              <item name="taskDetail" type="462c0819:PsiDirectoryNode" />
+              <item name="domain" type="462c0819:PsiDirectoryNode" />
             </path>
             <path>
               <item name="wms2" type="b2602c69:ProjectViewProjectNode" />
@@ -351,18 +353,6 @@
               <item name="wms2" type="462c0819:PsiDirectoryNode" />
               <item name="src" type="462c0819:PsiDirectoryNode" />
               <item name="main" type="462c0819:PsiDirectoryNode" />
-              <item name="java" type="462c0819:PsiDirectoryNode" />
-              <item name="com" type="462c0819:PsiDirectoryNode" />
-              <item name="huaheng" type="462c0819:PsiDirectoryNode" />
-              <item name="pc" type="462c0819:PsiDirectoryNode" />
-              <item name="task" type="462c0819:PsiDirectoryNode" />
-              <item name="taskPreference" type="462c0819:PsiDirectoryNode" />
-            </path>
-            <path>
-              <item name="wms2" type="b2602c69:ProjectViewProjectNode" />
-              <item name="wms2" type="462c0819:PsiDirectoryNode" />
-              <item name="src" type="462c0819:PsiDirectoryNode" />
-              <item name="main" type="462c0819:PsiDirectoryNode" />
               <item name="resources" type="462c0819:PsiDirectoryNode" />
             </path>
             <path>
@@ -380,37 +370,7 @@
               <item name="main" type="462c0819:PsiDirectoryNode" />
               <item name="resources" type="462c0819:PsiDirectoryNode" />
               <item name="templates" type="462c0819:PsiDirectoryNode" />
-              <item name="inventory" type="462c0819:PsiDirectoryNode" />
-            </path>
-            <path>
-              <item name="wms2" type="b2602c69:ProjectViewProjectNode" />
-              <item name="wms2" type="462c0819:PsiDirectoryNode" />
-              <item name="src" type="462c0819:PsiDirectoryNode" />
-              <item name="main" type="462c0819:PsiDirectoryNode" />
-              <item name="resources" type="462c0819:PsiDirectoryNode" />
-              <item name="templates" type="462c0819:PsiDirectoryNode" />
-              <item name="inventory" type="462c0819:PsiDirectoryNode" />
-              <item name="adjustDetail" type="462c0819:PsiDirectoryNode" />
-            </path>
-            <path>
-              <item name="wms2" type="b2602c69:ProjectViewProjectNode" />
-              <item name="wms2" type="462c0819:PsiDirectoryNode" />
-              <item name="src" type="462c0819:PsiDirectoryNode" />
-              <item name="main" type="462c0819:PsiDirectoryNode" />
-              <item name="resources" type="462c0819:PsiDirectoryNode" />
-              <item name="templates" type="462c0819:PsiDirectoryNode" />
-              <item name="inventory" type="462c0819:PsiDirectoryNode" />
-              <item name="adjustHeader" type="462c0819:PsiDirectoryNode" />
-            </path>
-            <path>
-              <item name="wms2" type="b2602c69:ProjectViewProjectNode" />
-              <item name="wms2" type="462c0819:PsiDirectoryNode" />
-              <item name="src" type="462c0819:PsiDirectoryNode" />
-              <item name="main" type="462c0819:PsiDirectoryNode" />
-              <item name="resources" type="462c0819:PsiDirectoryNode" />
-              <item name="templates" type="462c0819:PsiDirectoryNode" />
-              <item name="inventory" type="462c0819:PsiDirectoryNode" />
-              <item name="cycleCountDetail" type="462c0819:PsiDirectoryNode" />
+              <item name="task" type="462c0819:PsiDirectoryNode" />
             </path>
             <path>
               <item name="wms2" type="b2602c69:ProjectViewProjectNode" />
@@ -419,15 +379,13 @@
               <item name="main" type="462c0819:PsiDirectoryNode" />
               <item name="resources" type="462c0819:PsiDirectoryNode" />
               <item name="templates" type="462c0819:PsiDirectoryNode" />
-              <item name="inventory" type="462c0819:PsiDirectoryNode" />
-              <item name="cycleCountHeader" type="462c0819:PsiDirectoryNode" />
+              <item name="task" type="462c0819:PsiDirectoryNode" />
+              <item name="taskHeader" type="462c0819:PsiDirectoryNode" />
             </path>
           </expand>
           <select />
         </subPane>
       </pane>
-      <pane id="PackagesPane" />
-      <pane id="Scope" />
     </panes>
   </component>
   <component name="PropertiesComponent">
@@ -442,6 +400,8 @@
     <property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
     <property name="WebServerToolWindowFactoryState" value="false" />
     <property name="aspect.path.notification.shown" value="true" />
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1567684191959" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/../web_cms" />
     <property name="list.type.of.created.stylesheet" value="CSS" />
     <property name="node.js.detected.package.eslint" value="true" />
     <property name="node.js.path.for.package.eslint" value="project" />
@@ -451,12 +411,6 @@
     <property name="nodejs_package_manager_path" value="npm" />
     <property name="settings.editor.selected.configurable" value="Settings.JavaScript" />
   </component>
-  <component name="RecentsManager">
-    <key name="MoveFile.RECENT_KEYS">
-      <recent name="C:\Project\wms2\src\main\resources\templates\inventory\adjustDetail" />
-      <recent name="C:\Project\wms2\src\main\resources\templates\inventory\adjustHeader" />
-    </key>
-  </component>
   <component name="RunDashboard">
     <option name="configurationTypes">
       <set>
@@ -477,7 +431,7 @@
   </component>
   <component name="RunManager">
     <configuration name="HuaHengApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
-      <module name="wms2" />
+      <module name="huaheng" />
       <option name="SPRING_BOOT_MAIN_CLASS" value="com.huaheng.HuaHengApplication" />
       <option name="ALTERNATIVE_JRE_PATH" />
       <option name="UPDATE_ACTION_UPDATE_POLICY" value="UpdateClassesAndResources" />
@@ -492,17 +446,7 @@
       <serviceView>
         <option name="contentProportion" value="0.17857143" />
         <treeState>
-          <expand>
-            <path>
-              <item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
-              <item name="com.intellij.execution.services.ServiceModel$ServiceGroupNode@b9e1b2d7" type="7427dc5b:ServiceModel$ServiceGroupNode" />
-            </path>
-            <path>
-              <item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
-              <item name="com.intellij.execution.services.ServiceModel$ServiceGroupNode@b9e1b2d7" type="7427dc5b:ServiceModel$ServiceGroupNode" />
-              <item name="com.intellij.execution.services.ServiceModel$ServiceGroupNode@67b24c63" type="7427dc5b:ServiceModel$ServiceGroupNode" />
-            </path>
-          </expand>
+          <expand />
           <select />
         </treeState>
       </serviceView>
@@ -513,7 +457,7 @@
   </component>
   <component name="TaskManager">
     <task active="true" id="Default" summary="Default task">
-      <changelist id="908d8a6f-e3e4-4fdc-b674-e523a3e2b520" name="Default Changelist" comment="" />
+      <changelist id="4d9bac65-d8f6-4ced-8855-0db48f39a5f2" name="Default Changelist" comment="" />
       <created>1566977677142</created>
       <option name="number" value="Default" />
       <option name="presentableId" value="Default" />
@@ -523,6 +467,7 @@
       <workItem from="1567038752582" duration="12361000" />
       <workItem from="1567057373550" duration="15293000" />
       <workItem from="1567125196953" duration="16752000" />
+      <workItem from="1567643852002" duration="245000" />
     </task>
     <task id="LOCAL-00001" summary="入库单添加时添加流程标记,审核入库单">
       <created>1566983055587</created>
@@ -580,76 +525,58 @@
       <option name="project" value="LOCAL" />
       <updated>1567069834248</updated>
     </task>
-    <option name="localTasksCounter" value="9" />
+    <task id="LOCAL-00009" summary="出库任务完成。新增allocationId字段">
+      <created>1567672551433</created>
+      <option name="number" value="00009" />
+      <option name="presentableId" value="LOCAL-00009" />
+      <option name="project" value="LOCAL" />
+      <updated>1567672551433</updated>
+    </task>
+    <option name="localTasksCounter" value="10" />
     <servers />
   </component>
+  <component name="TimeTrackingManager">
+    <option name="totallyTimeSpent" value="22177000" />
+  </component>
   <component name="ToolWindowManager">
-    <frame x="-7" y="-7" width="1550" height="838" extended-state="6" />
+    <frame x="-7" y="-7" width="1550" height="838" extended-state="7" />
     <editor active="true" />
     <layout>
-      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.19839142" />
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.28016084" />
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
-      <window_info id="Web" order="2" side_tool="true" />
-      <window_info id="Designer" order="3" />
-      <window_info id="UI Designer" order="4" />
-      <window_info id="Favorites" order="5" side_tool="true" />
+      <window_info id="Designer" order="2" />
+      <window_info id="Image Layers" order="3" />
+      <window_info id="Capture Tool" order="4" />
+      <window_info id="UI Designer" order="5" />
+      <window_info id="Favorites" order="6" side_tool="true" />
+      <window_info id="Web" order="7" side_tool="true" />
       <window_info anchor="bottom" id="Message" order="0" />
-      <window_info anchor="bottom" id="Find" order="1" weight="0.3286119" />
+      <window_info anchor="bottom" id="Find" order="1" />
       <window_info anchor="bottom" id="Run" order="2" />
-      <window_info anchor="bottom" id="Debug" order="3" weight="0.29036826" />
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
       <window_info anchor="bottom" id="TODO" order="6" />
-      <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
-      <window_info anchor="bottom" id="Version Control" order="8" sideWeight="0.49932975" weight="0.08073654" />
-      <window_info anchor="bottom" id="Database Changes" order="9" weight="0.3286119" />
-      <window_info anchor="bottom" id="Spring" order="10" />
-      <window_info anchor="bottom" id="MyBatis Log" order="11" weight="0.3286119" />
-      <window_info anchor="bottom" id="Event Log" order="12" sideWeight="0.50067025" side_tool="true" weight="0.6090652" />
-      <window_info anchor="bottom" id="Messages" order="13" weight="0.04249292" />
-      <window_info anchor="bottom" id="Java Enterprise" order="14" />
-      <window_info active="true" anchor="bottom" id="Run Dashboard" order="15" sideWeight="0.49932975" visible="true" weight="0.17280453" />
+      <window_info anchor="bottom" id="Spring" order="7" />
+      <window_info anchor="bottom" id="Terminal" order="8" />
+      <window_info anchor="bottom" id="Docker" order="9" show_stripe_button="false" />
+      <window_info anchor="bottom" id="Event Log" order="10" sideWeight="0.5013405" side_tool="true" weight="0.2719547" />
+      <window_info anchor="bottom" id="Messages" order="11" weight="0.18696883" />
+      <window_info anchor="bottom" id="Java Enterprise" order="12" />
+      <window_info anchor="bottom" id="Database Changes" order="13" weight="0.3286119" />
+      <window_info anchor="bottom" id="Version Control" order="14" weight="0.3286119" />
+      <window_info anchor="bottom" id="Run Dashboard" order="15" sideWeight="0.49865952" weight="0.2719547" />
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
-      <window_info anchor="right" id="Palette" order="3" />
-      <window_info anchor="right" id="Database" order="4" />
-      <window_info anchor="right" id="Maven" order="5" weight="0.097184986" />
-      <window_info anchor="right" id="Bean Validation" order="6" />
+      <window_info anchor="right" id="Maven" order="3" />
+      <window_info anchor="right" id="Palette" order="4" />
+      <window_info anchor="right" id="Capture Analysis" order="5" />
+      <window_info anchor="right" id="Database" order="6" />
       <window_info anchor="right" id="Palette&#9;" order="7" />
+      <window_info anchor="right" id="Theme Preview" order="8" />
+      <window_info anchor="right" id="Bean Validation" order="9" />
     </layout>
-    <layout-to-restore>
-      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.26340482" />
-      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
-      <window_info id="Web" order="2" side_tool="true" />
-      <window_info id="Designer" order="3" />
-      <window_info id="UI Designer" order="4" />
-      <window_info id="Favorites" order="5" side_tool="true" />
-      <window_info anchor="bottom" id="Message" order="0" />
-      <window_info anchor="bottom" id="Find" order="1" weight="0.3286119" />
-      <window_info anchor="bottom" id="Run" order="2" />
-      <window_info anchor="bottom" id="Debug" order="3" weight="0.29036826" />
-      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
-      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
-      <window_info anchor="bottom" id="TODO" order="6" />
-      <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
-      <window_info anchor="bottom" id="Version Control" order="8" weight="0.45042494" />
-      <window_info anchor="bottom" id="Database Changes" order="9" />
-      <window_info anchor="bottom" id="Spring" order="10" />
-      <window_info anchor="bottom" id="MyBatis Log" order="11" weight="0.3286119" />
-      <window_info anchor="bottom" id="Event Log" order="12" sideWeight="0.50067025" side_tool="true" weight="0.23796034" />
-      <window_info anchor="bottom" id="Messages" order="13" weight="0.12606232" />
-      <window_info anchor="bottom" id="Java Enterprise" order="14" />
-      <window_info active="true" anchor="bottom" id="Run Dashboard" order="15" sideWeight="0.49932975" visible="true" weight="0.18838526" />
-      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
-      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
-      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
-      <window_info anchor="right" id="Palette" order="3" />
-      <window_info anchor="right" id="Database" order="4" />
-      <window_info anchor="right" id="Maven" order="5" weight="0.097184986" />
-      <window_info anchor="right" id="Bean Validation" order="6" />
-      <window_info anchor="right" id="Palette&#9;" order="7" />
-    </layout-to-restore>
   </component>
   <component name="TypeScriptGeneratedFilesManager">
     <option name="version" value="1" />
@@ -666,14 +593,7 @@
               <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
                 <collection />
               </option>
-              <option name="COLUMN_ORDER">
-                <list>
-                  <option value="0" />
-                  <option value="1" />
-                  <option value="2" />
-                  <option value="3" />
-                </list>
-              </option>
+              <option name="COLUMN_ORDER" />
             </State>
           </value>
         </entry>
@@ -695,7 +615,6 @@
     </option>
   </component>
   <component name="VcsManagerConfiguration">
-    <option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
     <MESSAGE value="盘点明细页面" />
     <MESSAGE value="入库单添加时添加流程标记,审核入库单" />
     <MESSAGE value="添加入库单历史" />
@@ -708,9 +627,8 @@
     <MESSAGE value="库存和任务移库相关" />
     <MESSAGE value="库存移库生成和完成逻辑" />
     <MESSAGE value="xml" />
-    <MESSAGE value="空托出入库,完成逻辑" />
-    <MESSAGE value="pull" />
-    <option name="LAST_COMMIT_MESSAGE" value="pull" />
+    <MESSAGE value="出库任务完成。新增allocationId字段" />
+    <option name="LAST_COMMIT_MESSAGE" value="出库任务完成。新增allocationId字段" />
   </component>
   <component name="XDebuggerManager">
     <breakpoint-manager>
@@ -734,30 +652,6 @@
           <option name="timeStamp" value="16" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java</url>
-          <line>216</line>
-          <properties />
-          <option name="timeStamp" value="19" />
-        </line-breakpoint>
-        <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java</url>
-          <line>241</line>
-          <properties />
-          <option name="timeStamp" value="20" />
-        </line-breakpoint>
-        <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java</url>
-          <line>163</line>
-          <properties />
-          <option name="timeStamp" value="22" />
-        </line-breakpoint>
-        <line-breakpoint enabled="true" type="java-line">
-          <url>file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java</url>
-          <line>181</line>
-          <properties />
-          <option name="timeStamp" value="23" />
-        </line-breakpoint>
-        <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/receipt/receiptHeader/service/ReceiptHeaderService.java</url>
           <line>92</line>
           <properties />
@@ -769,386 +663,175 @@
           <properties />
           <option name="timeStamp" value="26" />
         </line-breakpoint>
+        <line-breakpoint enabled="true" type="java-line">
+          <url>file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java</url>
+          <line>48</line>
+          <properties />
+          <option name="timeStamp" value="37" />
+        </line-breakpoint>
       </breakpoints>
     </breakpoint-manager>
+    <watches-manager>
+      <configuration name="SpringBootApplicationConfigurationType">
+        <watch expression="DataUtils.getInteger(map.get(&quot;receiptId&quot;))" language="JAVA" />
+      </configuration>
+    </watches-manager>
+  </component>
+  <component name="debuggerHistoryManager">
+    <expressions id="watch">
+      <expression>
+        <expression-string>DataUtils.getInteger(map.get(&quot;receiptId&quot;))</expression-string>
+        <language-id>JAVA</language-id>
+        <evaluation-mode>EXPRESSION</evaluation-mode>
+      </expression>
+    </expressions>
   </component>
   <component name="editorHistoryManager">
-    <entry file="jar://C:/Program Files/Java/jdk1.8.0_202/src.zip!/com/sun/jmx/snmp/tasks/Task.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="330">
-          <caret line="57" column="17" selection-start-line="57" selection-start-column="17" selection-end-line="57" selection-end-column="17" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailServiceImpl.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="80">
-          <caret line="10" column="13" selection-start-line="10" selection-start-column="13" selection-end-line="10" selection-end-column="13" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailService.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="60">
-          <caret line="4" column="62" selection-start-line="4" selection-start-column="62" selection-end-line="4" selection-end-column="62" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="jar://$MAVEN_REPOSITORY$/com/baomidou/mybatis-plus-core/3.1.2/mybatis-plus-core-3.1.2.jar!/com/baomidou/mybatisplus/core/mapper/BaseMapper.class">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="80">
-          <caret line="13" column="43" lean-forward="true" selection-start-line="13" selection-start-column="43" selection-end-line="13" selection-end-column="43" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/resources/mybatis/task/TaskDetailMapper.xml">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="464">
-          <caret line="54" column="25" lean-forward="true" selection-start-line="54" selection-start-column="25" selection-end-line="54" selection-end-column="25" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskDetail/mapper/TaskDetailMapper.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="100">
-          <caret line="6" column="1" lean-forward="true" selection-start-line="6" selection-start-column="1" selection-end-line="6" selection-end-column="1" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskDetail/domain/TaskDetail.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="304">
-          <caret line="43" column="19" selection-start-line="43" selection-start-column="19" selection-end-line="43" selection-end-column="19" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskDetail/service/TaskDetailServiceImpl.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="80">
-          <caret line="10" column="13" selection-start-line="10" selection-start-column="13" selection-end-line="10" selection-end-column="13" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskDetail/service/TaskDetailService.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="60">
-          <caret line="4" column="17" selection-start-line="4" selection-start-column="17" selection-end-line="4" selection-end-column="17" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/domain/ShipmentTaskCreateModel.java">
+    <entry file="jar://$MAVEN_REPOSITORY$/com/baomidou/mybatis-plus-extension/3.1.2/mybatis-plus-extension-3.1.2.jar!/com/baomidou/mybatisplus/extension/service/IService.class">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-12">
-          <caret line="5" column="13" selection-start-line="5" selection-start-column="13" selection-end-line="5" selection-end-column="13" />
+        <state relative-caret-position="149">
+          <caret line="53" column="12" selection-start-line="53" selection-start-column="12" selection-end-line="53" selection-end-column="12" />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/main/resources/mybatis/task/TaskHeaderMapper.xml">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="322">
-          <caret line="18" column="4" selection-start-line="18" selection-start-column="4" selection-end-line="18" selection-end-column="4" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/resources/mybatis/inventory/InventoryTransactionMapper.xml">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="308">
-          <caret line="28" column="50" selection-start-line="28" selection-start-column="50" selection-end-line="28" selection-end-column="50" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryTransaction/mapper/InventoryTransactionMapper.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="80">
-          <caret line="5" column="17" selection-start-line="5" selection-start-column="17" selection-end-line="5" selection-end-column="17" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/domain/TaskHeader.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="1048">
-          <caret line="316" column="69" selection-start-line="316" selection-start-column="69" selection-end-line="316" selection-end-column="69" />
+        <state relative-caret-position="146">
+          <caret line="45" column="31" selection-start-line="45" selection-start-column="16" selection-end-line="45" selection-end-column="31" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryTransaction/domain/InventoryTransaction.java">
+    <entry file="file://$PROJECT_DIR$/src/main/resources/templates/task/task/task.html">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="324">
-          <caret line="179" column="18" selection-start-line="179" selection-start-column="18" selection-end-line="179" selection-end-column="18" />
+        <state relative-caret-position="1444">
+          <caret line="76" column="89" selection-start-line="76" selection-start-column="70" selection-end-line="76" selection-end-column="89" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/containerType/service/ContainerTypeServiceImpl.java">
+    <entry file="file://$PROJECT_DIR$/pom.xml">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="400">
-          <caret line="31" selection-start-line="31" selection-end-line="31" />
+        <state relative-caret-position="532">
+          <caret line="28" column="8" selection-start-line="28" selection-start-column="8" selection-end-line="28" selection-end-column="51" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/resources/templates/config/container/add.html">
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="164">
-          <caret line="10" column="95" selection-start-line="10" selection-start-column="95" selection-end-line="10" selection-end-column="95" />
+        <state relative-caret-position="-66">
+          <caret line="238" column="16" selection-start-line="238" selection-start-column="16" selection-end-line="238" selection-end-column="16" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/mapper/TaskHeaderMapper.java">
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailService.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="120">
-          <caret line="11" column="78" selection-start-line="11" selection-start-column="78" selection-end-line="11" selection-end-column="78" />
+        <state relative-caret-position="209">
+          <caret line="13" column="9" selection-start-line="13" selection-start-column="9" selection-end-line="13" selection-end-column="9" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/resources/templates/inventory/inventoryHeader/transfer.html">
+    <entry file="file://$PROJECT_DIR$/src/main/resources/templates/task/taskHeader/taskHeader.html">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-264">
-          <caret line="13" column="54" selection-start-line="13" selection-start-column="54" selection-end-line="13" selection-end-column="54" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="jar://C:/Program Files/Java/jdk1.8.0_202/src.zip!/java/util/function/Function.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="460">
-          <caret line="46" column="32" selection-start-line="46" selection-start-column="32" selection-end-line="46" selection-end-column="32" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryTransaction/service/InventoryTransactionService.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="60">
-          <caret line="4" column="17" selection-start-line="4" selection-start-column="17" selection-end-line="4" selection-end-column="17" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="jar://$MAVEN_REPOSITORY$/com/baomidou/mybatis-plus-extension/3.1.2/mybatis-plus-extension-3.1.2.jar!/com/baomidou/mybatisplus/extension/service/IService.class">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="216">
-          <caret line="37" column="20" selection-start-line="37" selection-start-column="20" selection-end-line="37" selection-end-column="20" />
+        <state relative-caret-position="214">
+          <caret line="236" column="64" selection-start-line="236" selection-start-column="64" selection-end-line="236" selection-end-column="64" />
           <folding>
-            <element signature="e#1400#1401#0" expanded="true" />
-            <element signature="e#1463#1464#0" expanded="true" />
+            <element signature="n#style#0;n#i#0;n#a#0;n#!!top" expanded="true" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderService.java">
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/mapper/TaskHeaderMapper.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="100">
-          <caret line="8" column="61" selection-start-line="8" selection-start-column="61" selection-end-line="8" selection-end-column="61" />
+        <state relative-caret-position="114">
+          <caret line="11" column="30" selection-start-line="11" selection-start-column="30" selection-end-line="11" selection-end-column="30" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/resources/templates/inventory/inventoryDetail/inventoryDetail.html">
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="185">
-          <caret line="335" column="16" lean-forward="true" selection-start-line="335" selection-start-column="16" selection-end-line="335" selection-end-column="16" />
-          <folding>
-            <element signature="e#4822#10729#0" />
-          </folding>
+        <state relative-caret-position="323">
+          <caret line="136" column="42" selection-start-line="136" selection-start-column="42" selection-end-line="136" selection-end-column="42" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailService.java">
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/controller/TaskHeaderController.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="140">
-          <caret line="9" selection-start-line="9" selection-end-line="9" />
+        <state relative-caret-position="542">
+          <caret line="117" column="45" lean-forward="true" selection-start-line="117" selection-start-column="45" selection-end-line="117" selection-end-column="45" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryDetail/controller/InventoryDetailController.java">
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderService.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="173">
-          <caret line="104" column="25" selection-start-line="104" selection-start-column="25" selection-end-line="104" selection-end-column="25" />
+        <state relative-caret-position="209">
+          <caret line="18" column="15" selection-start-line="18" selection-start-column="15" selection-end-line="18" selection-end-column="15" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/container/service/ContainerService.java">
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryTransaction/domain/InventoryTransaction.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="200">
-          <caret line="15" selection-start-line="15" selection-end-line="15" />
+        <state relative-caret-position="226">
+          <caret line="95" column="19" selection-start-line="95" selection-start-column="12" selection-end-line="95" selection-end-column="19" />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/main/resources/mybatis/config/ContainerMapper.xml">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="436">
-          <caret line="50" column="23" selection-start-line="50" selection-start-column="23" selection-end-line="50" selection-end-column="23" />
+        <state relative-caret-position="490">
+          <caret line="50" column="4" selection-start-line="50" selection-start-column="4" selection-end-line="50" selection-end-column="4" />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/container/mapper/ContainerMapper.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="180">
-          <caret line="14" selection-start-line="14" selection-end-line="14" />
+        <state relative-caret-position="171">
+          <caret line="14" column="9" selection-start-line="14" selection-start-column="9" selection-end-line="14" selection-end-column="9" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/location/mapper/LocationMapper.java">
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/container/service/ContainerServiceImpl.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="280">
-          <caret line="16" column="1" lean-forward="true" selection-start-line="16" selection-start-column="1" selection-end-line="16" selection-end-column="1" />
+        <state relative-caret-position="471">
+          <caret line="127" column="47" lean-forward="true" selection-start-line="127" selection-start-column="47" selection-end-line="127" selection-end-column="47" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/resources/mybatis/config/LocationMapper.xml">
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/container/service/ContainerService.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="446">
-          <caret line="49" column="132" lean-forward="true" selection-start-line="49" selection-start-column="132" selection-end-line="49" selection-end-column="132" />
+        <state relative-caret-position="228">
+          <caret line="17" column="9" selection-start-line="17" selection-start-column="9" selection-end-line="17" selection-end-column="9" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/location/service/LocationServiceImpl.java">
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskDetail/domain/TaskDetail.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="326">
-          <caret line="116" column="7" lean-forward="true" selection-start-line="116" selection-start-column="7" selection-end-line="116" selection-end-column="7" />
-          <folding>
-            <element signature="e#4932#4933#0" expanded="true" />
-            <element signature="e#4992#4993#0" expanded="true" />
-          </folding>
+        <state relative-caret-position="226">
+          <caret line="65" column="19" selection-start-line="65" selection-start-column="19" selection-end-line="65" selection-end-column="19" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/container/service/ContainerServiceImpl.java">
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderService.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="392">
-          <caret line="123" column="13" lean-forward="true" selection-start-line="123" selection-start-column="13" selection-end-line="123" selection-end-column="13" />
+        <state relative-caret-position="266">
+          <caret line="18" column="15" selection-start-line="18" selection-start-column="15" selection-end-line="18" selection-end-column="15" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/config/location/service/LocationService.java">
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="220">
-          <caret line="12" column="96" selection-start-line="12" selection-start-column="96" selection-end-line="12" selection-end-column="96" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderService.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="216">
-          <caret line="18" column="15" selection-start-line="18" selection-start-column="15" selection-end-line="18" selection-end-column="15" />
+        <state relative-caret-position="340">
+          <caret line="112" column="26" selection-start-line="112" selection-start-column="16" selection-end-line="112" selection-end-column="26" />
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="363">
-          <caret line="924" lean-forward="true" selection-start-line="924" selection-end-line="924" />
+        <state relative-caret-position="376">
+          <caret line="1089" column="13" lean-forward="true" selection-start-line="1089" selection-start-column="13" selection-end-line="1089" selection-end-column="13" />
           <folding>
             <element signature="imports" expanded="true" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryTransaction/service/InventoryTransactionServiceImpl.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="80">
-          <caret line="10" column="13" selection-start-line="10" selection-start-column="13" selection-end-line="10" selection-end-column="13" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderServiceImpl.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="671">
-          <caret line="60" column="12" selection-start-line="60" selection-start-column="12" selection-end-line="60" selection-end-column="12" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-525">
-          <caret line="44" column="22" selection-start-line="44" selection-start-column="22" selection-end-line="44" selection-end-column="22" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryTransaction/controller/InventoryTransactionController.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-1060">
-          <caret line="33" column="13" selection-start-line="33" selection-start-column="13" selection-end-line="33" selection-end-column="13" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/inventoryHeader/controller/InventoryHeaderController.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="1531">
-          <caret line="214" column="20" selection-start-line="214" selection-start-column="20" selection-end-line="214" selection-end-column="20" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/task/taskHeader/controller/TaskHeaderController.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="367">
-          <caret line="117" column="42" selection-start-line="117" selection-start-column="42" selection-end-line="117" selection-end-column="42" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/resources/templates/inventory/cycleCountHeader/cycleCountHeader.html">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-12">
-          <caret line="273" column="18" selection-start-line="273" selection-start-column="18" selection-end-line="273" selection-end-column="18" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/resources/static/huaheng/js/huahengUI.js">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="304">
-          <caret line="44" column="25" lean-forward="true" selection-start-line="43" selection-start-column="52" selection-end-line="44" selection-end-column="25" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/resources/templates/inventory/adjustDetail/adjustDetail.html">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="196">
-          <caret line="323" column="16" lean-forward="true" selection-start-line="323" selection-start-column="16" selection-end-line="323" selection-end-column="16" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/resources/templates/inventory/adjustHeader/adjustHeader.html">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="163">
-          <caret line="187" column="30" lean-forward="true" selection-start-line="187" selection-start-column="30" selection-end-line="187" selection-end-column="30" />
-          <folding>
-            <element signature="n#style#0;n#a#0;n#!!top" expanded="true" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
-    <entry file="jar://$MAVEN_REPOSITORY$/org/springframework/spring-core/5.1.5.RELEASE/spring-core-5.1.5.RELEASE.jar!/org/springframework/cglib/proxy/MethodProxy.class">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="167">
-          <caret line="102" selection-start-line="102" selection-end-line="102" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/domain/CycleCountDetail.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="120">
-          <caret line="13" column="13" selection-start-line="13" selection-start-column="13" selection-end-line="13" selection-end-column="13" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/resources/templates/inventory/cycleCountDetail/cycleCountDetail.html">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-87">
-          <caret line="122" selection-start-line="122" selection-end-line="122" />
-          <folding>
-            <element signature="e#6120#12518#0" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/controller/CycleCountHeaderController.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-567">
-          <caret line="44" column="51" selection-start-line="44" selection-start-column="51" selection-end-line="44" selection-end-column="51" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="8">
-          <caret line="64" column="52" lean-forward="true" selection-start-line="64" selection-start-column="52" selection-end-line="64" selection-end-column="52" />
-        </state>
-      </provider>
-    </entry>
   </component>
 </project>
\ No newline at end of file
diff --git a/src/main/java/com/huaheng/pc/inventory/adjustDetail/controller/adjustDetailController.java b/src/main/java/com/huaheng/pc/inventory/adjustDetail/controller/adjustDetailController.java
index a7ce8a9..d4592c2 100644
--- a/src/main/java/com/huaheng/pc/inventory/adjustDetail/controller/adjustDetailController.java
+++ b/src/main/java/com/huaheng/pc/inventory/adjustDetail/controller/adjustDetailController.java
@@ -14,7 +14,6 @@ import com.huaheng.framework.web.page.TableDataInfo;
 import com.huaheng.framework.web.page.TableSupport;
 import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail;
 import com.huaheng.pc.inventory.adjustDetail.service.AdjustDetailService;
-
 import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderService;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
diff --git a/src/main/java/com/huaheng/pc/inventory/adjustDetail/domain/AdjustDetail.java b/src/main/java/com/huaheng/pc/inventory/adjustDetail/domain/AdjustDetail.java
index fb36eb4..a467c4b 100644
--- a/src/main/java/com/huaheng/pc/inventory/adjustDetail/domain/AdjustDetail.java
+++ b/src/main/java/com/huaheng/pc/inventory/adjustDetail/domain/AdjustDetail.java
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
 import lombok.Data;
 
@@ -142,21 +143,21 @@ public class AdjustDetail implements Serializable {
      */
     @TableField(value = "fromQty")
     @ApiModelProperty(value="调整前的数量")
-    private Integer fromQty;
+    private BigDecimal fromQty;
 
     /**
      * 调整后的数量 
      */
     @TableField(value = "toQty")
     @ApiModelProperty(value="调整后的数量 ")
-    private Integer toQty;
+    private BigDecimal toQty;
 
     /**
      * 调整变动数量 
      */
     @TableField(value = "gapQty")
     @ApiModelProperty(value="调整变动数量 ")
-    private Integer gapQty;
+    private BigDecimal gapQty;
 
     /**
      * 状态 -0-待调整 1-已调整 2-未批准 3-已批准
diff --git a/src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailService.java b/src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailService.java
index cd088f4..00b7c60 100644
--- a/src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailService.java
+++ b/src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailService.java
@@ -1,10 +1,14 @@
 package com.huaheng.pc.inventory.adjustDetail.service;
 
-import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail;
-import com.huaheng.pc.inventory.adjustDetail.mapper.AdjustDetailMapper;
-@Service
-public class AdjustDetailService extends ServiceImpl<AdjustDetailMapper, AdjustDetail> {
+
+
+
+public interface AdjustDetailService extends IService<AdjustDetail> {
+
+
 
 }
+
+
diff --git a/src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailServiceImpl.java b/src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailServiceImpl.java
new file mode 100644
index 0000000..51de3d6
--- /dev/null
+++ b/src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailServiceImpl.java
@@ -0,0 +1,10 @@
+package com.huaheng.pc.inventory.adjustDetail.service;
+
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail;
+import com.huaheng.pc.inventory.adjustDetail.mapper.AdjustDetailMapper;
+@Service
+public class AdjustDetailServiceImpl extends ServiceImpl<AdjustDetailMapper, AdjustDetail> implements AdjustDetailService {
+
+}
diff --git a/src/main/java/com/huaheng/pc/inventory/adjustHeader/controller/adjustHeaderController.java b/src/main/java/com/huaheng/pc/inventory/adjustHeader/controller/adjustHeaderController.java
index 6c8e9c4..451857d 100644
--- a/src/main/java/com/huaheng/pc/inventory/adjustHeader/controller/adjustHeaderController.java
+++ b/src/main/java/com/huaheng/pc/inventory/adjustHeader/controller/adjustHeaderController.java
@@ -13,8 +13,10 @@ import com.huaheng.framework.web.page.PageDomain;
 import com.huaheng.framework.web.page.TableDataInfo;
 import com.huaheng.framework.web.page.TableSupport;
 import com.huaheng.pc.inventory.adjustDetail.service.AdjustDetailService;
+import com.huaheng.pc.inventory.adjustDetail.service.AdjustDetailServiceImpl;
 import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader;
 import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderService;
+import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderServiceImpl;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
diff --git a/src/main/java/com/huaheng/pc/inventory/adjustHeader/mapper/AdjustHeaderMapper.java b/src/main/java/com/huaheng/pc/inventory/adjustHeader/mapper/AdjustHeaderMapper.java
index 4e8fd0f..886bec6 100644
--- a/src/main/java/com/huaheng/pc/inventory/adjustHeader/mapper/AdjustHeaderMapper.java
+++ b/src/main/java/com/huaheng/pc/inventory/adjustHeader/mapper/AdjustHeaderMapper.java
@@ -4,4 +4,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader;
 
 public interface AdjustHeaderMapper extends BaseMapper<AdjustHeader> {
+
+
+    String getLastCode();
+
+
+
 }
\ No newline at end of file
diff --git a/src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderService.java b/src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderService.java
index 69cc150..3709d1c 100644
--- a/src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderService.java
+++ b/src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderService.java
@@ -1,10 +1,18 @@
 package com.huaheng.pc.inventory.adjustHeader.service;
 
-import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader;
-import com.huaheng.pc.inventory.adjustHeader.mapper.AdjustHeaderMapper;
-@Service
-public class AdjustHeaderService extends ServiceImpl<AdjustHeaderMapper, AdjustHeader> {
+import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader;
+
+
+public interface AdjustHeaderService extends IService<AdjustHeader> {
+
+
+    String createCode();
+
+
+
 
 }
+
+
diff --git a/src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderServiceImpl.java b/src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderServiceImpl.java
new file mode 100644
index 0000000..cb273b8
--- /dev/null
+++ b/src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderServiceImpl.java
@@ -0,0 +1,49 @@
+package com.huaheng.pc.inventory.adjustHeader.service;
+
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader;
+import com.huaheng.pc.inventory.adjustHeader.mapper.AdjustHeaderMapper;
+
+import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+@Service
+public class AdjustHeaderServiceImpl extends ServiceImpl<AdjustHeaderMapper, AdjustHeader> implements AdjustHeaderService {
+
+
+    @Resource
+    private AdjustHeaderMapper adjustHeaderMapper;
+
+
+
+
+
+
+    //生成差异单号
+    @Override
+    public String createCode() {
+        String code;
+        Date now = new Date();
+        SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
+        String maxCode =  adjustHeaderMapper.getLastCode();;
+        //如果指定类型的最后的code存在,并且日期一致。那么 code = 单类型 + 年月日 + (排序号 + 1)
+        if (maxCode != null && maxCode.substring(maxCode.length() - 13, maxCode.length() - 5).equals(df.format(now)))
+        {
+            Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5, maxCode.length()));
+            code = "CY" + df.format(now) + String.format("%05d", Count + 1);
+        }
+        else
+        {
+            code = "CY" + df.format(now) + "00001";
+        }
+        return code;
+    }
+
+
+
+
+
+
+}
diff --git a/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java b/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java
index fd1b908..e762f6d 100644
--- a/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java
+++ b/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java
@@ -14,8 +14,9 @@ import com.huaheng.framework.web.page.TableDataInfo;
 import com.huaheng.framework.web.page.TableSupport;
 import com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail;
 import com.huaheng.pc.inventory.cycleCountDetail.service.CycleCountDetailService;
-import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader;
+import com.huaheng.pc.inventory.cycleCountDetail.service.CycleCountDetailServiceImpl;
 import com.huaheng.pc.inventory.cycleCountHeader.service.CycleCountHeaderService;
+import com.huaheng.pc.inventory.cycleCountHeader.service.CycleCountHeaderServiceImpl;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -23,7 +24,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.annotation.Resource;
-import java.util.Collections;
 import java.util.List;
 
 
@@ -57,7 +57,7 @@ public class CycleCountDetailController extends BaseController {
     @PostMapping("/list")
     @Log(title = "库存-盘点",operating = "查看盘点明细", action = BusinessType.GRANT)
     @ResponseBody
-    public TableDataInfo list(CycleCountDetail cycleCountDetail, String createdBegin, String createdEnd) {
+    public TableDataInfo list(CycleCountDetail cycleCountDetail, String createdBegin, String createdEnd) throws IllegalAccessException {
 
         LambdaQueryWrapper<CycleCountDetail> lambdaQueryWrapper = Wrappers.lambdaQuery();
         PageDomain pageDomain = TableSupport.buildPageRequest();
@@ -92,7 +92,7 @@ public class CycleCountDetailController extends BaseController {
             IPage<CycleCountDetail> iPage = cycleCountDetailService.page(page, lambdaQueryWrapper);
             return getMpDataTable(iPage.getRecords(), iPage.getTotal());
         } else {
-            List<CycleCountDetail> list = cycleCountDetailService.list(lambdaQueryWrapper);
+            List<CycleCountDetail> list  = cycleCountDetailService.list(lambdaQueryWrapper);
             return getDataTable(list);
         }
 
diff --git a/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/domain/CycleCountDetail.java b/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/domain/CycleCountDetail.java
index d770af4..31ab4bb 100644
--- a/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/domain/CycleCountDetail.java
+++ b/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/domain/CycleCountDetail.java
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
 
 @ApiModel(value="com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail")
@@ -122,21 +123,21 @@ public class CycleCountDetail implements Serializable {
      */
     @TableField(value = "systemQty")
     @ApiModelProperty(value="系统数量")
-    private Long systemQty;
+    private BigDecimal systemQty;
 
     /**
      * 实盘数量
      */
     @TableField(value = "countedQty")
     @ApiModelProperty(value="实盘数量")
-    private Long countedQty;
+    private BigDecimal countedQty;
 
     /**
      * 差异数量
      */
     @TableField(value = "gapQty")
     @ApiModelProperty(value="差异数量")
-    private Long gapQty;
+    private BigDecimal gapQty;
 
     /**
      * 失败原因
@@ -562,52 +563,27 @@ public class CycleCountDetail implements Serializable {
         this.inventorySts = inventorySts;
     }
 
-    /**
-     * 获取系统数量
-     *
-     * @return systemQty - 系统数量
-     */
-    public Long getSystemQty() {
+    public BigDecimal getSystemQty() {
         return systemQty;
     }
 
-    /**
-     * 设置系统数量
-     *
-     * @param systemQty 系统数量
-     */
-    public void setSystemQty(Long systemQty) {
+    public void setSystemQty(BigDecimal systemQty) {
         this.systemQty = systemQty;
     }
 
-    /**
-     * 获取实盘数量
-     *
-     * @return countedQty - 实盘数量
-     */
-    public Long getCountedQty() {
+    public BigDecimal getCountedQty() {
         return countedQty;
     }
 
-    /**
-     * 设置实盘数量
-     *
-     * @param countedQty 实盘数量
-     */
-    public void setCountedQty(Long countedQty) {
+    public void setCountedQty(BigDecimal countedQty) {
         this.countedQty = countedQty;
     }
 
-    /**
-     * 获取调整数量
-     *
-     * @return gapQty- 调整数量
-     */
-    public Long getGapQty() {
+    public BigDecimal getGapQty() {
         return gapQty;
     }
 
-    public void setGapQty(Long gapQty) {
+    public void setGapQty(BigDecimal gapQty) {
         this.gapQty = gapQty;
     }
 
diff --git a/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailService.java b/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailService.java
index 37fab40..aba817a 100644
--- a/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailService.java
+++ b/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailService.java
@@ -1,10 +1,14 @@
 package com.huaheng.pc.inventory.cycleCountDetail.service;
 
-import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.huaheng.pc.inventory.cycleCountDetail.mapper.CycleCountDetailMapper;
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail;
-@Service
-public class CycleCountDetailService extends ServiceImpl<CycleCountDetailMapper, CycleCountDetail> {
+import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader;
+
+
+public interface CycleCountDetailService extends IService<CycleCountDetail> {
+
+
 
 }
+
+
diff --git a/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailServiceImpl.java b/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailServiceImpl.java
new file mode 100644
index 0000000..50ee0e8
--- /dev/null
+++ b/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailServiceImpl.java
@@ -0,0 +1,15 @@
+package com.huaheng.pc.inventory.cycleCountDetail.service;
+
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huaheng.pc.inventory.cycleCountDetail.mapper.CycleCountDetailMapper;
+import com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail;
+@Service
+public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMapper, CycleCountDetail> implements CycleCountDetailService {
+
+
+
+
+
+
+}
diff --git a/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/controller/CycleCountHeaderController.java b/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/controller/CycleCountHeaderController.java
index 246ac4c..6c65101 100644
--- a/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/controller/CycleCountHeaderController.java
+++ b/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/controller/CycleCountHeaderController.java
@@ -4,29 +4,32 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.huaheng.common.support.Convert;
 import com.huaheng.common.utils.StringUtils;
 import com.huaheng.common.utils.security.ShiroUtils;
 import com.huaheng.framework.aspectj.lang.annotation.Log;
 import com.huaheng.framework.aspectj.lang.constant.BusinessType;
 import com.huaheng.framework.web.controller.BaseController;
+import com.huaheng.framework.web.domain.AjaxResult;
 import com.huaheng.framework.web.page.PageDomain;
 import com.huaheng.framework.web.page.TableDataInfo;
 import com.huaheng.framework.web.page.TableSupport;
-import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader;
 import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderService;
+import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderServiceImpl;
+import com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail;
 import com.huaheng.pc.inventory.cycleCountDetail.service.CycleCountDetailService;
+import com.huaheng.pc.inventory.cycleCountDetail.service.CycleCountDetailServiceImpl;
 import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader;
 
 import com.huaheng.pc.inventory.cycleCountHeader.service.CycleCountHeaderService;
-import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
+import com.huaheng.pc.inventory.cycleCountHeader.service.CycleCountHeaderServiceImpl;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -92,11 +95,114 @@ public class CycleCountHeaderController extends BaseController {
         }
 
     }
+    /**
+     * 新增盘点单主
+     */
+    @GetMapping("/add")
+    public String add()
+    {
+        return prefix + "/add";
+    }
 
+    /**
+     * 新增保存盘点单主
+     */
+    //@RequiresPermissions("inventory:cycleCount:add")
+    @Log(title = "库存-盘点",operating = "新增盘点主单", action = BusinessType.INSERT)
+    @PostMapping("/add")
+    @ResponseBody
+    public AjaxResult addSave(CycleCountHeader cycleCountHeader)
+    {
 
+        cycleCountHeader.setWarehouseCode(ShiroUtils.getWarehouseCode());
+        //cycleCountHeader.setCompanyCode(cycleCountHeader.getCompanyCode());
+        //cycleCountHeader.setRound(cycleCountHeader.getRound());//盘点轮次
+        cycleCountHeader.setCreated(new Date());
+        cycleCountHeader.setCreatedBy(ShiroUtils.getLoginName());
+        cycleCountHeader.setMasterCode(cycleCountHeaderService.createCode());
+        return toAjax(cycleCountHeaderService.save(cycleCountHeader));
+    }
 
+    /**
+     * 修改盘点单主
+     */
+    @GetMapping("/edit/{id}")
+    public String edit(@PathVariable("id") Integer id, ModelMap mmap)
+    {
+        CycleCountHeader cyclecountHeader = cycleCountHeaderService.getById(id);
+        mmap.put("cyclecountHeader", cyclecountHeader);
+        return prefix + "/edit";
+    }
 
+    /**
+     * 修改保存盘点单主
+     */
+    //@RequiresPermissions("inventory:cycleCount:edit")
+    @Log(title = "库存-盘点",operating = "修改盘点主单", action = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    @ResponseBody
+    public AjaxResult editSave(CycleCountHeader cycleCountHeader)
+    {
+        cycleCountHeader.setLastUpdatedBy(ShiroUtils.getLoginName());
+        cycleCountHeader.setLastUpdated(new Date());
+        return toAjax(cycleCountHeaderService.saveOrUpdate(cycleCountHeader));
+    }
 
+    /**
+     * 删除盘点单主
+     */
+    //@RequiresPermissions("inventory:cycleCount:remove")
+    @Log(title = "库存-盘点",operating = "删除盘点主单", action = BusinessType.DELETE)
+    @PostMapping( "/remove")
+    @ResponseBody
+    public AjaxResult remove(String ids)
+    {
+        if (StringUtils.isEmpty(ids))
+            return AjaxResult.error("id不能为空");
+        for (Integer id : Convert.toIntArray(ids))
+        {
+            AjaxResult result = cycleCountHeaderService.delete(id);
+            if(result.code!=200){
+                return result;
+            }
+        }
+        return AjaxResult.success("删除成功!");
+    }
+
+    /**
+     *
+     * 生成差异调整单
+     * */
+    //@RequiresPermissions("inventory:cyclecountHead:addAdjust")
+    @Log(title = "库存-盘点", operating = "新增盘点差异调整单", action = BusinessType.INSERT)
+    @PostMapping("/goAdjust")
+    @ResponseBody
+    public AjaxResult goAdjust(int id)
+    {
+        return (cycleCountHeaderService.insertByAdjust(id));
+    }
+
+
+    /**
+     *  盘点单报表打印
+     * @return
+     */
+    //@RequiresPermissions("inventory:cycleCount:report")
+    @GetMapping("/report/{id}")
+    public String report(@PathVariable("id") Integer id, ModelMap mmap)
+    {
+        CycleCountHeader cyclecountHeader = cycleCountHeaderService.getById(id);
+        mmap.put("cyclecountHeader", cyclecountHeader);
+
+        CycleCountDetail condition = new CycleCountDetail();
+        condition.setCycleCountHeadId(id);
+        condition.setWarehouseCode(ShiroUtils.getWarehouseCode());
+        LambdaQueryWrapper lambda = Wrappers.lambdaQuery(condition);
+        List<CycleCountDetail> details =  cycleCountDetailService.list(lambda);
+        mmap.put("details", details);
+
+        return prefix + "/report";
+    }
 
 
 
diff --git a/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/domain/CycleCountHeader.java b/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/domain/CycleCountHeader.java
index 62d04d1..1270805 100644
--- a/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/domain/CycleCountHeader.java
+++ b/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/domain/CycleCountHeader.java
@@ -59,7 +59,7 @@ public class CycleCountHeader implements Serializable {
      */
     @TableField(value = "countType")
     @ApiModelProperty(value="盘点类型")
-    private Integer countType;
+    private String countType;
 
     /**
      * 盘点状态
@@ -342,21 +342,11 @@ public class CycleCountHeader implements Serializable {
         this.companyCode = companyCode;
     }
 
-    /**
-     * 获取盘点类型
-     *
-     * @return countType - 盘点类型
-     */
-    public Integer getCountType() {
+    public String getCountType() {
         return countType;
     }
 
-    /**
-     * 设置盘点类型
-     *
-     * @param countType 盘点类型
-     */
-    public void setCountType(Integer countType) {
+    public void setCountType(String countType) {
         this.countType = countType;
     }
 
diff --git a/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/mapper/CycleCountHeaderMapper.java b/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/mapper/CycleCountHeaderMapper.java
index eb334c1..e768932 100644
--- a/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/mapper/CycleCountHeaderMapper.java
+++ b/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/mapper/CycleCountHeaderMapper.java
@@ -4,4 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader;
 
 public interface CycleCountHeaderMapper extends BaseMapper<CycleCountHeader> {
+
+    String getLastCode();
+
+
+
 }
\ No newline at end of file
diff --git a/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderService.java b/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderService.java
index 2f5df02..8a0e3ee 100644
--- a/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderService.java
+++ b/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderService.java
@@ -1,12 +1,23 @@
 package com.huaheng.pc.inventory.cycleCountHeader.service;
 
-import org.springframework.stereotype.Service;
-import javax.annotation.Resource;
-import java.util.List;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.huaheng.framework.web.domain.AjaxResult;
 import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader;
-import com.huaheng.pc.inventory.cycleCountHeader.mapper.CycleCountHeaderMapper;
-@Service
-public class CycleCountHeaderService extends ServiceImpl<CycleCountHeaderMapper, CycleCountHeader> {
+
+
+public interface CycleCountHeaderService extends IService<CycleCountHeader> {
+
+
+    String createCode();
+    //生成调整单
+    AjaxResult insertByAdjust(Integer headId);
+
+    AjaxResult delete(Integer id);
+
+
+
+
 
 }
+
+
diff --git a/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderServiceImpl.java b/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderServiceImpl.java
new file mode 100644
index 0000000..b5e0949
--- /dev/null
+++ b/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderServiceImpl.java
@@ -0,0 +1,184 @@
+package com.huaheng.pc.inventory.cycleCountHeader.service;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.huaheng.common.exception.service.ServiceException;
+import com.huaheng.common.utils.security.ShiroUtils;
+import com.huaheng.framework.web.domain.AjaxResult;
+import com.huaheng.pc.config.warehouse.domain.Warehouse;
+import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail;
+import com.huaheng.pc.inventory.adjustDetail.service.AdjustDetailService;
+import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader;
+import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderService;
+import com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail;
+import com.huaheng.pc.inventory.cycleCountDetail.service.CycleCountDetailService;
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.security.SecureRandomSpi;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.WeakHashMap;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader;
+import com.huaheng.pc.inventory.cycleCountHeader.mapper.CycleCountHeaderMapper;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service
+public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMapper, CycleCountHeader> implements CycleCountHeaderService {
+
+
+    @Resource
+    private CycleCountHeaderMapper cycleCountHeaderMapper;
+    @Resource
+    private CycleCountDetailService cycleCountDetailService;
+    @Resource
+    private AdjustHeaderService adjustHeaderService;
+    @Resource
+    private AdjustDetailService adjustDetailService;
+
+
+
+
+
+
+
+
+    /**
+     * 生成盘点单主Code
+     * @return
+     */
+    @Override
+    public String createCode() {
+        String code;
+        Date now = new Date();
+        SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
+        String maxCode =  cycleCountHeaderMapper.getLastCode();;
+        //如果指定类型的最后的code存在,并且日期一致。那么 code = 单类型 + 年月日 + (排序号 + 1)
+        if (maxCode != null && maxCode.substring(maxCode.length() - 13, maxCode.length() - 5).equals(df.format(now)))
+        {
+            Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5));
+            code = "PD" + df.format(now) + String.format("%05d", Count + 1);
+        }
+        else
+        {
+            code = "PD" + df.format(now) + "00001";
+        }
+        return code;
+    }
+
+    /**
+     * 删除单据
+     * @param id
+     * @return
+     */
+    @Override
+    public AjaxResult delete(Integer id) {
+
+        CycleCountHeader cyclecountHeader = this.getById(id);
+        if(cyclecountHeader==null){
+            return AjaxResult.error("id为"+id.toString()+"的盘点单不存在出,操作中止");
+        }
+        if(cyclecountHeader.getStatusCyc() > 0){
+            return AjaxResult.error("盘点单:"+cyclecountHeader.getMasterCode()+"非新建状态,无法删除,操作中止");
+        }
+        //批量删除子单据
+        CycleCountDetail temp = new CycleCountDetail();
+        temp.setWarehouseCode(ShiroUtils.getWarehouseCode());
+        temp.setCycleCountHeadId(cyclecountHeader.getId());
+        LambdaQueryWrapper lm = Wrappers.lambdaQuery(temp);
+        cycleCountDetailService.remove(lm);
+        cycleCountHeaderMapper.deleteById(id);
+        return AjaxResult.success("盘点主单和明细删除成功");
+
+    }
+
+    /**
+     * 新增盘点差异调整单
+     * */
+    @Transactional
+    public AjaxResult insertByAdjust(Integer id) {
+
+        /*获取盘点主单ID生成差异调整单,根据主单ID获取明细条目,再根据明细条目差异数量是否为0生成差异调整详单*/
+        //1 根据盘点单ID生成差异调整主单,2 下一步根据盘点主单ID查询盘点明细的条目数据,
+        //3 for循环明细条目,同时依据差异数据是否为0来决定是否生成差异单,同步写入调整单详细。
+
+        //查询该条盘点单头 id
+        CycleCountHeader cyclecountHeader = cycleCountHeaderMapper.selectById(id);
+
+        if(cyclecountHeader.getStatusCyc() >= 35){
+            //查询是否已生成差异单
+            throw new ServiceException("该条盘点单无法生成调整单,请检查状态!");
+        }
+
+        AdjustHeader adjustHeader = new AdjustHeader();
+        adjustHeader.setWarehouseCode(ShiroUtils.getWarehouseCode());//仓库
+        adjustHeader.setCode(adjustHeaderService.createCode());//生成差异单号
+        adjustHeader.setProblemType("盘点调整");
+        adjustHeader.setCycleCountCode(cyclecountHeader.getMasterCode());
+        adjustHeader.setCompanyCode(cyclecountHeader.getCompanyCode());
+        adjustHeader.setCreated(new Date());
+        adjustHeader.setCreatedBy(ShiroUtils.getLoginName());
+        //adjustHeader.setStatus(10);//新建未上传
+        //先创建调整单头
+        adjustHeaderService.save(adjustHeader);
+
+        //根据盘点单查询明细并写入调整单
+        CycleCountDetail cycleCountDetail = new CycleCountDetail();
+        cycleCountDetail.setCycleCountHeadId(id);
+        cycleCountDetail.setWarehouseCode(cyclecountHeader.getWarehouseCode());
+        LambdaQueryWrapper lam = Wrappers.lambdaQuery(cycleCountDetail);
+        List<CycleCountDetail> cycleCountDetailList = cycleCountDetailService.list(lam);
+        //找到刚刚生成的调整主单
+        //AdjustHeader adjust = adjustHeaderService.getById(adjustHeader.getId());
+        //循环明细条目,查找符合条件的数据写入调整单明细
+        AdjustDetail adjustDetail = new AdjustDetail();
+        for(CycleCountDetail item:cycleCountDetailList){
+            //BigDecimal的比较  .compareTo(BigDecimal.ZERO) != 0
+            if(item.getGapQty().compareTo(BigDecimal.ZERO) != 0){
+                //比较差异数量不为0的就生成差异单
+                adjustDetail.setAdjustCode(adjustHeader.getCode());
+                adjustDetail.setWarehouseCode(adjustHeader.getWarehouseCode());
+                adjustDetail.setCompanyCode(adjustHeader.getCompanyCode());
+                adjustDetail.setLocationCode(item.getLocationCode());
+                adjustDetail.setContainerCode(item.getContainerCode());
+                adjustDetail.setCycleCountCode(cyclecountHeader.getMasterCode());
+                adjustDetail.setMaterialCode(item.getMaterialCode());
+                adjustDetail.setMaterialName(item.getMaterialName());
+                adjustDetail.setMaterialSpec(item.getMaterialSpec());
+                adjustDetail.setMaterialUnit(item.getMaterialUnit());
+                adjustDetail.setCycleDetailId(item.getId());
+                adjustDetail.setProblemType("盘点调整");
+                adjustDetail.setToInventorySts(item.getInventorySts());//盘点不涉及属性
+                adjustDetail.setFromInventorySts(item.getInventorySts());
+                adjustDetail.setFromQty(item.getSystemQty());//调整前数量
+                adjustDetail.setToQty(null);//调整后数量
+                adjustDetail.setGapQty(item.getGapQty());//调整数量
+                adjustDetail.setCreated(new Date());
+                adjustDetail.setCreatedBy(ShiroUtils.getLoginName());
+                //adjustDetail.setStatus(0);//状态
+
+                adjustDetailService.save(adjustDetail);
+            }
+
+        }
+
+        //修改盘点主单状态为已生成差异单
+
+        cyclecountHeader.setStatusCyc(35);
+        this.saveOrUpdate(cyclecountHeader);
+
+        return AjaxResult.success("差异调整及明细单生成完毕!");
+    }
+
+
+
+
+
+
+
+
+}
diff --git a/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailService.java b/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailService.java
index 96af1bf..9d8f509 100644
--- a/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailService.java
+++ b/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailService.java
@@ -3,6 +3,7 @@ package com.huaheng.pc.inventory.inventoryDetail.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.huaheng.framework.web.domain.AjaxResult;
 import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
+import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail;
 
 import java.util.List;
 
@@ -11,7 +12,7 @@ public interface InventoryDetailService extends IService<InventoryDetail> {
 
     AjaxResult detailcreateCheckOutTask (Integer id);
 
-    List<InventoryDetail> selectBysql(String sql);
+    List<InventoryDetail> selectBysql(String sql, ShipmentDetail shipmentDetail);
 
 }
 
diff --git a/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java b/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java
index 457d060..24b68ef 100644
--- a/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java
+++ b/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java
@@ -9,6 +9,7 @@ import com.huaheng.framework.web.domain.AjaxResult;
 import com.huaheng.pc.config.location.domain.Location;
 import com.huaheng.pc.config.location.service.LocationService;
 import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
+import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail;
 import com.huaheng.pc.task.taskDetail.domain.TaskDetail;
 import com.huaheng.pc.task.taskDetail.service.TaskDetailService;
 import com.huaheng.pc.task.taskHeader.domain.TaskHeader;
@@ -103,7 +104,11 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe
     }
 
     @Override
-    public List<InventoryDetail> selectBysql(String sql) {
+    public List<InventoryDetail> selectBysql(String sql, ShipmentDetail shipmentDetail) {
+        sql=sql+" \n" +"and warehouseCode='" + shipmentDetail.getWarehouseCode()+"' \n" +
+                "and companyCode='" + shipmentDetail.getCompanyCode()+"' \n" +
+                "and materialCode='" + shipmentDetail.getMaterialCode() +"' \n" +
+                "and inventorySts='" + shipmentDetail.getInventorySts() + "'";
         return inventoryDetailMapper.selectBysql(sql);
     }
 
diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java b/src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
index 279cbed..dd5326b 100644
--- a/src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
+++ b/src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
@@ -21,7 +21,10 @@ import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader;
 import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService;
 import com.huaheng.pc.shipment.shippingCombination.domain.ShippingSearch;
 import com.huaheng.pc.shipment.shippingCombination.service.ShippingCombinationService;
+import com.huaheng.pc.task.taskDetail.domain.TaskDetail;
+import com.huaheng.pc.task.taskDetail.service.TaskDetailService;
 import com.huaheng.pc.task.taskHeader.domain.ShipmentTaskCreateModel;
+import com.huaheng.pc.task.taskHeader.domain.TaskHeader;
 import com.huaheng.pc.task.taskHeader.service.TaskHeaderService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -58,6 +61,8 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont
     private ShippingCombinationService shippingCombinationService;
     @Autowired
     private TaskHeaderService taskHeaderService;
+    @Autowired
+    private TaskDetailService taskDetailService;
 
 
     @Override
@@ -106,24 +111,26 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont
         Location location = locationService.getOne(lambdaQueryWrapper);
         if (location == null)
             throw new ServiceException("库位 "+ inventoryDetail.getLocationCode() +" 不存在");
-        if (location.getStatus().equals("lock"))    {
-            //如果库位状态是锁定的话,就查找出库组盘表,如果存在未下发
-            LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery();
-            lam.eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode())
-                    .eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode())
-                    .eq(ShipmentContainerHeader::getTaskCreated,0);
-            ShipmentContainerHeader shipmentContainerHeader = this.getOne(lam);
-            if (shipmentContainerHeader == null)    {
-                throw new ServiceException("库位已经锁定不能使用");
-            }
-        }
+//        if (location.getStatus().equals("lock"))    {
+//            //如果库位状态是锁定的话,就查找出库组盘表,如果存在未下发
+//            LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery();
+//            lam.eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode())
+//                    .eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode())
+//                    .eq(ShipmentContainerHeader::getTaskCreated,0);
+//            ShipmentContainerHeader shipmentContainerHeader = this.getOne(lam);
+//            if (shipmentContainerHeader == null)    {
+//                throw new ServiceException("库位已经锁定不能使用");
+//            }
+//        }
 
         //更新库存分配数
         inventoryDetail.setTaskQty(inventoryDetail.getTaskQty().add(shipmentCombinationModel.getShipQty()));
         inventoryDetailService.saveOrUpdate(inventoryDetail);
         //获取库位,然后锁定
-        location.setStatus("lock");
-        locationService.saveOrUpdate(location);
+        if(location.getStatus().equals("empty")) {
+            location.setStatus("lock");
+            locationService.saveOrUpdate(location);
+        }
         //更新单据明细的已出库数量
         shipmentDetail.setRequestQty(shipmentDetail.getRequestQty().add(shipmentCombinationModel.getShipQty()));
         int i = shipmentDetail.getShipQty().compareTo(shipmentDetail.getRequestQty());
@@ -166,20 +173,19 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont
         LambdaQueryWrapper<ShipmentContainerHeader> lambdaQueryWrapper=Wrappers.lambdaQuery();
         lambdaQueryWrapper.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode())
                 .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode())
-                .eq(ShipmentContainerHeader::getTaskCreated,1)
-                .eq(ShipmentContainerHeader::getStatus,10);
+                .le(ShipmentContainerHeader::getStatus,20);
         ShipmentContainerHeader shipmentContainerHeader = this.getOne(lambdaQueryWrapper);
         if(shipmentContainerHeader != null)  {
-            throw new ServiceException("容器"+location.getContainerCode()+"已经生成任务,不能再添加明细;操作中止;");
+            return shipmentContainerHeader;
         }
         else {
-            LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery();
-            lam.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode())
-                    .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode())
-                    .eq(ShipmentContainerHeader::getTaskCreated,0)
-                    .eq(ShipmentContainerHeader::getStatus,0);
-            shipmentContainerHeader = this.getOne(lam);
-            if (shipmentContainerHeader == null) {
+//            LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery();
+//            lam.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode())
+//                    .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode())
+//                    .eq(ShipmentContainerHeader::getTaskCreated,0)
+//                    .eq(ShipmentContainerHeader::getStatus,0);
+//            shipmentContainerHeader = this.getOne(lam);
+//            if (shipmentContainerHeader == null) {
                 shipmentContainerHeader = new ShipmentContainerHeader();
                 shipmentContainerHeader.setContainerCode(location.getContainerCode());
                 shipmentContainerHeader.setLocationCode(location.getCode());
@@ -194,9 +200,9 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont
 //            material.setCode(shipmentDetail.getMaterialCode());
 //            shipmentContainerHeader.setZoneCode(materialService.selectFirstEntity(material).getZoneCode());
                 this.save(shipmentContainerHeader);
+            return shipmentContainerHeader;
             }
-        }
-        return shipmentContainerHeader;
+//        }
     }
 
     /**
@@ -246,6 +252,45 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont
             shipmentContainerDetail.setCreatedBy(ShiroUtils.getLoginName());
             shipmentContainerDetailService.save(shipmentContainerDetail);
         }
+
+        //
+        if(shipmentContainerHeader.getStatus()<=10){
+            LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper=Wrappers.lambdaQuery();
+            taskHeaderLambdaQueryWrapper.eq(TaskHeader::getWarehouseCode,shipmentContainerHeader.getWarehouseCode())
+                    .eq(TaskHeader::getInternalTaskType,200)
+                    .eq(TaskHeader::getAllocationHeadId,shipmentContainerHeader.getId());
+            TaskHeader taskHeader=taskHeaderService.getOne(taskHeaderLambdaQueryWrapper);
+            if(taskHeader==null){
+                throw new ServiceException("找不到相应的任务头");
+            }
+            TaskDetail taskDetail = new TaskDetail();
+            taskDetail.setTaskId(taskHeader.getId());
+            taskDetail.setInternalTaskType(taskHeader.getInternalTaskType());
+            taskDetail.setWarehouseCode(taskHeader.getWarehouseCode());
+            taskDetail.setCompanyCode(taskHeader.getCompanyCode());
+            taskDetail.setTaskType(taskHeader.getTaskType());
+            taskDetail.setAllocationId(shipmentContainerDetail.getId());
+            taskDetail.setBillCode(shipmentContainerDetail.getShipmentCode());
+            taskDetail.setBillDetailId(shipmentContainerDetail.getShipmentDetailId());
+            taskDetail.setMaterialCode(shipmentContainerDetail.getMaterialCode());
+            taskDetail.setMaterialName(shipmentContainerDetail.getMaterialName());
+            taskDetail.setMaterialSpec(shipmentContainerDetail.getMaterialSpec());
+            taskDetail.setMaterialUnit(shipmentContainerDetail.getMaterialUnit());
+            taskDetail.setFromInventoryId(shipmentContainerDetail.getInventoryId());
+            taskDetail.setQty(shipmentContainerDetail.getQty());
+            taskDetail.setContainerCode(taskHeader.getContainerCode());
+            taskDetail.setFromLocation(taskHeader.getFromLocation());
+            taskDetail.setToLocation(taskHeader.getToLocation());
+            if(shipmentContainerHeader.getStatus()==10) {
+                taskDetail.setStatus(0);
+            }else {
+                taskDetail.setStatus(10);
+            }
+            taskDetail.setTaskType(taskHeader.getTaskType());
+            taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
+            taskDetail.setLastUpdated(null);
+            taskDetailService.save(taskDetail);
+        }
         return shipmentContainerDetail;
     }
 
@@ -360,13 +405,13 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentCont
                 continue;
             }
             // 根据 仓库编码、货主编码、存货编码,物料状态,项目号来查找可以出库的物料
-            ShippingSearch search = new ShippingSearch();
-            search.setWarehouseCode(ShiroUtils.getWarehouseCode());
-            search.setCompanyCode(item.getCompanyCode());
-            search.setMaterialCode(item.getMaterialCode());
-            search.setInventorySts(item.getInventorySts()); //物料状态
+//            ShippingSearch search = new ShippingSearch();
+//            search.setWarehouseCode(ShiroUtils.getWarehouseCode());
+//            search.setCompanyCode(item.getCompanyCode());
+//            search.setMaterialCode(item.getMaterialCode());
+//            search.setInventorySts(item.getInventorySts()); //物料状态
 
-            List<InventoryDetail> inventoryList = shippingCombinationService.getInventorys(search);
+            List<InventoryDetail> inventoryList = shippingCombinationService.getInventorys(item);
             if (inventoryList.size() < 1) {
                 num = num + 1;
             } else {
diff --git a/src/main/java/com/huaheng/pc/shipment/shippingCombination/controller/ShippingCombinationController.java b/src/main/java/com/huaheng/pc/shipment/shippingCombination/controller/ShippingCombinationController.java
index 67d1df9..47bc577 100644
--- a/src/main/java/com/huaheng/pc/shipment/shippingCombination/controller/ShippingCombinationController.java
+++ b/src/main/java/com/huaheng/pc/shipment/shippingCombination/controller/ShippingCombinationController.java
@@ -42,8 +42,7 @@ public class ShippingCombinationController extends BaseController {
 
     private String prefix = "shipment/shippingCombination";
 
-    @Autowired
-    MaterialServiceImpl materialService;
+
     @Autowired
     ShipmentDetailServiceImpl shipmentDetailService;
     @Autowired
@@ -54,14 +53,6 @@ public class ShippingCombinationController extends BaseController {
     ShipmentContainerDetailService shipmentContainerDetailService;
     @Autowired
     ShipmentHeaderService shipmentHeaderService;
-    @Autowired
-    InventoryDetailService inventoryDetailService;
-    @Autowired
-    ConfigValueService configValueService;
-    @Autowired
-    FilterConfigDetailService filterConfigDetailService;
-    @Autowired
-    ShipmentPreferenceService shipmentPreferenceService;
 
 
     /**
@@ -152,72 +143,8 @@ public class ShippingCombinationController extends BaseController {
             throw new ServiceException("找不到子单");
         }
 
+        List<InventoryDetail> list=shippingCombinationService.getInventorys(shipmentDetail);
         //查找分配规则
-        List<InventoryDetail> list=new ArrayList<>();
-        FilterConfigDetail filterConfigDetail=new FilterConfigDetail();
-        LambdaQueryWrapper<FilterConfigDetail> filterConfigDetailLambdaQueryWrapper=Wrappers.lambdaQuery();
-        filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getWarehouseCode,shipmentDetail.getWarehouseCode());
-
-        //出库子单的分配规则有时,优先出库子单的分配规则
-        if(StringUtils.isNotEmpty(shipmentDetail.getAllocationRule())){
-            filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,shipmentDetail.getAllocationRule());
-            filterConfigDetail=filterConfigDetailService.getOne(filterConfigDetailLambdaQueryWrapper);
-            if(filterConfigDetail==null){
-                throw new ServiceException("出库子单出库规则配置不存在");
-            }
-
-            //根据sql查库存
-            try {
-                list = inventoryDetailService.selectBysql(filterConfigDetail.getStatement());
-            }catch (Exception e){
-                throw new ServiceException("sql错误");
-            }
-            return getDataTable(list);
-        }
-
-        //出库子单的分配规则没有时,优先物料的分配规则
-        LambdaQueryWrapper<Material> materialLambdaQueryWrapper=Wrappers.lambdaQuery();
-        materialLambdaQueryWrapper.eq(Material::getCode,shipmentDetail.getMaterialCode())
-                .eq(Material::getWarehouseCode,shipmentDetail.getWarehouseCode());
-        Material material=materialService.getOne(materialLambdaQueryWrapper);
-        if(StringUtils.isNotEmpty(material.getAllocationRule())){
-            filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,material.getAllocationRule());
-            filterConfigDetail=filterConfigDetailService.getOne(filterConfigDetailLambdaQueryWrapper);
-            if(filterConfigDetail==null){
-                throw new ServiceException("物料出库规则配置不存在");
-            }
-
-            //根据sql查库存
-            list=inventoryDetailService.selectBysql(filterConfigDetail.getStatement());
-            return getDataTable(list);
-        }
-
-        //都没有时,默认仓库的分配规则
-        LambdaQueryWrapper<ConfigValue> configValueLambdaQueryWrapper=Wrappers.lambdaQuery();
-        configValueLambdaQueryWrapper.eq(ConfigValue::getModuleType,"shipment")
-                .eq(ConfigValue::getWarehouseCode,shipmentDetail.getWarehouseCode());
-        ConfigValue configValue=configValueService.getOne(configValueLambdaQueryWrapper);
-        if(configValue==null){
-            throw new ServiceException("仓库的出库配置不存在");
-        }
-
-        //查找出库首选项
-        LambdaQueryWrapper<ShipmentPreference> slam=Wrappers.lambdaQuery();
-        slam.eq(ShipmentPreference::getCode,configValue.getIdentifier())
-                .eq(ShipmentPreference::getWarehouseCode,configValue.getWarehouseCode());
-        ShipmentPreference shipmentPreference=shipmentPreferenceService.getOne(slam);
-        if(shipmentPreference==null){
-            throw new ServiceException("仓库的出库配置中出库首选项不存在");
-        }
-        //查找分配规则
-        filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,shipmentPreference.getAllocationRule());
-        filterConfigDetail=filterConfigDetailService.getOne(filterConfigDetailLambdaQueryWrapper);
-        if(filterConfigDetail==null){
-            throw new ServiceException("出库首选项中出库规则配置不存在");
-        }
-
-        //根据sql查库存
-        list=inventoryDetailService.selectBysql(filterConfigDetail.getStatement());
         return getDataTable(list);
     }
 
diff --git a/src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java b/src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java
index fba8f25..9c38262 100644
--- a/src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java
+++ b/src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java
@@ -1,12 +1,28 @@
 package com.huaheng.pc.shipment.shippingCombination.service;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.huaheng.common.exception.service.ServiceException;
+import com.huaheng.common.utils.StringUtils;
+import com.huaheng.pc.config.FilterConfigDetail.domain.FilterConfigDetail;
+import com.huaheng.pc.config.FilterConfigDetail.service.FilterConfigDetailService;
+import com.huaheng.pc.config.configValue.domain.ConfigValue;
+import com.huaheng.pc.config.configValue.service.ConfigValueService;
+import com.huaheng.pc.config.material.domain.Material;
+import com.huaheng.pc.config.material.service.MaterialServiceImpl;
+import com.huaheng.pc.config.shipmentPreference.domain.ShipmentPreference;
+import com.huaheng.pc.config.shipmentPreference.service.ShipmentPreferenceService;
 import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
+import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService;
+import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail;
 import com.huaheng.pc.shipment.shippingCombination.domain.ShippingSearch;
 import com.huaheng.pc.shipment.shippingCombination.mapper.ShippingCombinationMapper;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.List;
 
 
@@ -15,10 +31,86 @@ public class ShippingCombinationService {
 
     @Resource
     private ShippingCombinationMapper shippingCombinationMapper;
+    @Autowired
+    InventoryDetailService inventoryDetailService;
+    @Autowired
+    ConfigValueService configValueService;
+    @Autowired
+    FilterConfigDetailService filterConfigDetailService;
+    @Autowired
+    ShipmentPreferenceService shipmentPreferenceService;
+    @Autowired
+    MaterialServiceImpl materialService;
 
 
-    public List<InventoryDetail> getInventorys(ShippingSearch search) {
-        List<InventoryDetail> list = shippingCombinationMapper.getInventorys(search);
+
+    //根据分配规则查找库存
+    public List<InventoryDetail> getInventorys(ShipmentDetail shipmentDetail) {
+        List<InventoryDetail> list=new ArrayList<>();
+        FilterConfigDetail filterConfigDetail=new FilterConfigDetail();
+        LambdaQueryWrapper<FilterConfigDetail> filterConfigDetailLambdaQueryWrapper= Wrappers.lambdaQuery();
+        filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getWarehouseCode,shipmentDetail.getWarehouseCode());
+
+        //出库子单的分配规则有时,优先出库子单的分配规则
+        if(StringUtils.isNotEmpty(shipmentDetail.getAllocationRule())){
+            filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,shipmentDetail.getAllocationRule());
+            filterConfigDetail=filterConfigDetailService.getOne(filterConfigDetailLambdaQueryWrapper);
+            if(filterConfigDetail==null){
+                throw new ServiceException("出库子单出库规则配置不存在");
+            }
+
+            //根据sql查库存
+            try {
+                list = inventoryDetailService.selectBysql(filterConfigDetail.getStatement(),shipmentDetail);
+            }catch (Exception e){
+                throw new ServiceException("sql错误");
+            }
+            return list;
+        }
+
+        //出库子单的分配规则没有时,优先物料的分配规则
+        LambdaQueryWrapper<Material> materialLambdaQueryWrapper=Wrappers.lambdaQuery();
+        materialLambdaQueryWrapper.eq(Material::getCode,shipmentDetail.getMaterialCode())
+                .eq(Material::getWarehouseCode,shipmentDetail.getWarehouseCode());
+        Material material=materialService.getOne(materialLambdaQueryWrapper);
+        if(StringUtils.isNotEmpty(material.getAllocationRule())){
+            filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,material.getAllocationRule());
+            filterConfigDetail=filterConfigDetailService.getOne(filterConfigDetailLambdaQueryWrapper);
+            if(filterConfigDetail==null){
+                throw new ServiceException("物料出库规则配置不存在");
+            }
+
+            //根据sql查库存
+            list=inventoryDetailService.selectBysql(filterConfigDetail.getStatement(),shipmentDetail);
+            return list;
+        }
+
+        //都没有时,默认仓库的分配规则
+        LambdaQueryWrapper<ConfigValue> configValueLambdaQueryWrapper=Wrappers.lambdaQuery();
+        configValueLambdaQueryWrapper.eq(ConfigValue::getModuleType,"shipment")
+                .eq(ConfigValue::getWarehouseCode,shipmentDetail.getWarehouseCode());
+        ConfigValue configValue=configValueService.getOne(configValueLambdaQueryWrapper);
+        if(configValue==null){
+            throw new ServiceException("仓库的出库配置不存在");
+        }
+
+        //查找出库首选项
+        LambdaQueryWrapper<ShipmentPreference> slam=Wrappers.lambdaQuery();
+        slam.eq(ShipmentPreference::getCode,configValue.getIdentifier())
+                .eq(ShipmentPreference::getWarehouseCode,configValue.getWarehouseCode());
+        ShipmentPreference shipmentPreference=shipmentPreferenceService.getOne(slam);
+        if(shipmentPreference==null){
+            throw new ServiceException("仓库的出库配置中出库首选项不存在");
+        }
+        //查找分配规则
+        filterConfigDetailLambdaQueryWrapper.eq(FilterConfigDetail::getCode,shipmentPreference.getAllocationRule());
+        filterConfigDetail=filterConfigDetailService.getOne(filterConfigDetailLambdaQueryWrapper);
+        if(filterConfigDetail==null){
+            throw new ServiceException("出库首选项中出库规则配置不存在");
+        }
+
+        //根据sql查库存
+        list=inventoryDetailService.selectBysql(filterConfigDetail.getStatement(),shipmentDetail);
         return list;
     }
 
diff --git a/src/main/java/com/huaheng/pc/task/taskDetail/domain/TaskDetail.java b/src/main/java/com/huaheng/pc/task/taskDetail/domain/TaskDetail.java
index de5dffd..b13e2ea 100644
--- a/src/main/java/com/huaheng/pc/task/taskDetail/domain/TaskDetail.java
+++ b/src/main/java/com/huaheng/pc/task/taskDetail/domain/TaskDetail.java
@@ -57,6 +57,14 @@ public class TaskDetail implements Serializable {
     @ApiModelProperty(value="货主")
     private String companyCode;
 
+
+    /**
+     * 组盘子id
+     */
+    @TableField(value = "allocationId")
+    @ApiModelProperty(value="组盘子id")
+    private Integer allocationId;
+
     /**
      * 单据编码
      */
@@ -162,12 +170,6 @@ public class TaskDetail implements Serializable {
     @ApiModelProperty(value="参考单号")
     private String referenceCode;
 
-    /**
-     * 参考内部号
-     */
-    @TableField(value = "referenceId")
-    @ApiModelProperty(value="参考内部号")
-    private Integer referenceId;
 
     /**
      * 参考内部行号
@@ -379,6 +381,8 @@ public class TaskDetail implements Serializable {
 
     public static final String COL_COMPANYCODE = "companyCode";
 
+    public static final String COL_ALLOCATIONID= "allocationId";
+
     public static final String COL_BILLCODE= "billCode";
 
     public static final String COL_BILLDETAILID= "billDetailId";
diff --git a/src/main/java/com/huaheng/pc/task/taskHeader/domain/TaskHeader.java b/src/main/java/com/huaheng/pc/task/taskHeader/domain/TaskHeader.java
index 1c676ff..6e94931 100644
--- a/src/main/java/com/huaheng/pc/task/taskHeader/domain/TaskHeader.java
+++ b/src/main/java/com/huaheng/pc/task/taskHeader/domain/TaskHeader.java
@@ -43,6 +43,13 @@ public class TaskHeader implements Serializable {
     private Integer taskType;
 
     /**
+     * 入库或出库组盘头ID
+     */
+    @TableField(value = "allocationHeadId")
+    @ApiModelProperty(value="入库或出库组盘头ID")
+    private Integer allocationHeadId;
+
+    /**
      * 内部类型
      */
     @TableField(value = "internalTaskType")
diff --git a/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderService.java b/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderService.java
index 5188646..efd5185 100644
--- a/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderService.java
+++ b/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderService.java
@@ -31,6 +31,8 @@ public interface TaskHeaderService extends IService<TaskHeader>{
 
     AjaxResult createReceiptTask(List<Integer> ids);
 
+    void completeShipmentTask(TaskHeader task) ;
+
     Integer UncompleteCount(String containerCode);
 
 
diff --git a/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java b/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
index af356d7..caf80f5 100644
--- a/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
+++ b/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
@@ -30,12 +30,21 @@ import com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerD
 import com.huaheng.pc.shipment.shipmentContainerDetail.service.ShipmentContainerDetailService;
 import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader;
 import com.huaheng.pc.shipment.shipmentContainerHeader.service.ShipmentContainerHeaderService;
+import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail;
+import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService;
 import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader;
+import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService;
 import com.huaheng.pc.task.taskDetail.domain.TaskDetail;
 import com.huaheng.pc.task.taskDetail.service.TaskDetailService;
 import com.huaheng.pc.task.taskHeader.domain.ShipmentTaskCreateModel;
+import org.jsoup.helper.DataUtil;
 import org.springframework.stereotype.Service;
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
 import java.util.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.huaheng.pc.task.taskHeader.domain.TaskHeader;
@@ -74,6 +83,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
     @Resource
     private ReceiptContainerDetailService receiptContainerDetailService;
     @Resource
+    private ShipmentHeaderService shipmentHeaderService;
+    @Resource
+    private ShipmentDetailService shipmentDetailService;
+
+
+
+    @Resource
     private ReceiptContainerHeaderService receiptContainerHeaderService;
     @Resource
     private TaskHeaderMapper taskHeaderMapper;
@@ -156,12 +172,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
                 task.setToLocation("");
             }
         }
+        task.setInternalTaskType(200);
+        task.setAllocationHeadId(shipmentContainerHeader.getId());
         task.setWarehouseCode(shipmentContainerHeader.getWarehouseCode());
         task.setCompanyCode(shipmentContainerHeader.getCompanyCode());
-        task.setInternalTaskType(null);
         task.setAssignedUser(ShiroUtils.getLoginName());
         task.setConfirmedBy(ShiroUtils.getLoginName());
-        task.setStatus(1);
+        task.setStatus(0);
         task.setContainerCode(shipmentContainerHeader.getContainerCode());
         task.setCreatedBy(ShiroUtils.getLoginName());
         task.setCreated(new Date());
@@ -172,9 +189,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
         for (ShipmentContainerDetail shipmentContainerDetail : shipmentContainerDetails) {
             TaskDetail taskDetail = new TaskDetail();
             taskDetail.setTaskId(task.getId());
+            taskDetail.setInternalTaskType(task.getInternalTaskType());
             taskDetail.setWarehouseCode(task.getWarehouseCode());
             taskDetail.setCompanyCode(task.getCompanyCode());
             taskDetail.setTaskType(task.getTaskType());
+            taskDetail.setAllocationId(shipmentContainerDetail.getId());
             taskDetail.setBillCode(shipmentContainerDetail.getShipmentCode());
             taskDetail.setBillDetailId(shipmentContainerDetail.getShipmentDetailId());
             taskDetail.setMaterialCode(shipmentContainerDetail.getMaterialCode());
@@ -186,7 +205,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
             taskDetail.setContainerCode(task.getContainerCode());
             taskDetail.setFromLocation(task.getFromLocation());
             taskDetail.setToLocation(task.getToLocation());
-            taskDetail.setStatus(1);
+            taskDetail.setStatus(0);
             taskDetail.setTaskType(task.getTaskType());
             taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
             taskDetail.setLastUpdated(null);
@@ -205,7 +224,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
     /**
      * 下发WCS执行任务
      */
+    /**
+     *
+     * 执行任务
+     * */
     @Override
+    @Transactional
     public AjaxResult<TaskHeader> sendTaskToWcs(Integer[] taskIds) {
         TaskHeader task = null;
         for (Integer taskId : taskIds) {
@@ -220,7 +244,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
             task.setLastUpdatedBy(ShiroUtils.getLoginName());
             LambdaUpdateWrapper<TaskHeader> HeaderUpdateWrapper = Wrappers.lambdaUpdate();
             HeaderUpdateWrapper.eq(TaskHeader::getId, taskId);
-            taskHeaderService.update(task, HeaderUpdateWrapper);
+            if (!taskHeaderService.update(task, HeaderUpdateWrapper))
+                throw new ServiceException("更新任务头失败");
             //修改任务明细状态
             TaskDetail record = new TaskDetail();
             record.setStatus(10);
@@ -228,38 +253,24 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
             record.setLastUpdatedBy(ShiroUtils.getLoginName());
             LambdaUpdateWrapper<TaskDetail> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
             lambdaUpdateWrapper.eq(TaskDetail::getTaskId, task.getId());
-            taskDetailService.update(record, lambdaUpdateWrapper);
-
-
-//            if (task.getInternalTaskType().equals("100"))
-//            {
-//                List<Map<String, Object>> maps = taskDetailService.selectListMapByEqual("billId, billDetailId", condition);
-//                for (Map<String, Object> item : maps){
-//                    Integer billDetailId = DataUtils.getInteger(item.get("billDetailId"));
-//                    receiptHeaderService.updateDetailStatus(billDetailId, (short)300);
-//                }
-//                maps.stream().map(X -> X.get("billId")).distinct().forEach(X -> receiptHeaderService.receiptStatusUpdate(DataUtils.getInteger(X), (short)300));
-//            }
-//            //盘点单执行
-//            if(task.getType() == 700){
-//                CyclecountDetail cyclecountDetai = cyclecountDetailService.selectEntityById(
-//                        task.getAllocationHeadId());
-//                cyclecountDetai.setStatus(10);
-//                cyclecountDetailService.updateByModel(cyclecountDetai);
-//            }
-////            //如果是单排人工库,那么出入库都是先完成,在下发AGV任务
-////            if (task.getType().intValue() == 300 || task.getType().intValue() == 600)   {
-////                if (task.getSourceLocation().startsWith("L03") == false )   {
-////                    taskAgvService.createTaskAgv(task);
-////                }
-////            }
-////            else    {
-////                taskAgvService.createTaskAgv(task);
-////            }
-//            //任务类型是出库,那就完成任务在叫agv
-//            if (task.getType().intValue() == 100 || task.getType().intValue() == 500)   {
-//                taskAgvService.createTaskAgv(task);
-//            }
+            if (!taskDetailService.update(record, lambdaUpdateWrapper)){
+                throw new ServiceException("更新任务明细失败");
+            }
+            //修改入库明细
+            ReceiptDetail receiptDetail = receiptDetailService.queryflow(receiptDetailService.getById(record.getId()));
+            if (!receiptDetailService.updateById(receiptDetail)){
+                throw new ServiceException("更新状态失败");
+            }
+            receiptDetailService.updateReceiptHeaderLastStatus(receiptDetail.getReceiptId());
+            //修改组盘表状态为20
+            ReceiptContainerDetail receiptContainerDetail = new ReceiptContainerDetail();
+            receiptContainerDetail.setStatus(20);
+            receiptContainerDetail.setLastUpdated(new Date());
+            receiptContainerDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
+            LambdaUpdateWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate();
+            receiptContainerDetailLambdaUpdateWrapper.eq(ReceiptContainerDetail::getReceiptId,receiptDetail.getReceiptId());
+            if (! receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaUpdateWrapper))
+                throw new ServiceException("更新组盘状态失败");
         }
         return AjaxResult.success("下发任务成功", task);
     }
@@ -293,13 +304,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
      */
     public void completeTask(TaskHeader task) throws Exception {
         //区分任务类型
-        if (task.getInternalTaskType() == 100 || task.getInternalTaskType() == 200) {
+        if (task.getInternalTaskType() == 100) {
             //入库任务
             completeReceiptTask(task);
         }
-        if (task.getInternalTaskType() == 300 || task.getInternalTaskType() == 400) {
-//            //出库任务
-//            completeShipmentTask(task);
+        if (task.getInternalTaskType() == 200) {
+//            出库任务
+            completeShipmentTask(task);
         }
         // 700 盘点    900 出库查看,包过空托出库查看
         if (task.getInternalTaskType() == 700 || task.getInternalTaskType() == 900) {
@@ -321,9 +332,10 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
 
 
     /**
-     *
+     *完成任务
      */
     @Override
+    @Transactional
     public AjaxResult completeReceiptTask(TaskHeader task) throws Exception {
         List<Map<String, Object>> taskReceiptContainerDetail = taskHeaderMapper.getReceiptTask(task.getId());
         if (taskReceiptContainerDetail.size() < 1) {
@@ -344,13 +356,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
                     header.setWarehouseCode(DataUtils.getString(map.get("warehouseCode")));//仓库
                     header.setCompanyCode(task.getCompanyCode());//货主
                     header.setContainerCode(DataUtils.getString(map.get("containerCode")));//容器号
+                    header.setLocationCode(task.getToLocation());
                     header.setTotalQty(DataUtils.getInteger(map.get("totalQty")));//总数量
                     header.setLocking(1);
                     header.setEnable(1);
                     header.setCreatedBy(ShiroUtils.getLoginName());
                     header.setCreated(new Date());
                     header.setLastUpdated(new Date());
-                    inventoryHeaderService.save(header);
+                    if (!inventoryHeaderService.save(header))
+                        throw new ServiceException("添加库存单失败");
+
                     //库存明细添加
                     detail = new InventoryDetail();
                     detail.setInventoryHeaderId(header.getId());//库存头ID
@@ -366,19 +381,23 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
                     detail.setBatch(DataUtils.getString(map.get("batch")));//批次
                     detail.setLot(DataUtils.getString(map.get("lot")));//批号
                     detail.setInventorySts(DataUtils.getString(map.get("inventorySts")));//库存状态
-                    detail.setManufactureDate(DataUtils.getDateTime(map.get("manufactureDate")));//生产日期
-                    detail.setExpirationDate(DataUtils.getDateTime(map.get("expirationDate")));//失效日期
+                    detail.setManufactureDate(new SimpleDateFormat("yyyy-MM-dd").parse(map.get("manufactureDate").toString()));//生产日期
+//                    detail.setExpirationDate(new SimpleDateFormat("yyyy-MM-dd").parse(map.get("expirationDate").toString()));//失效日期
                     detail.setQty(DataUtils.getBigDecimal(map.get("qty")));//数量
                     detail.setTaskQty(DataUtils.getBigDecimal(map.get("qty")));
                     detail.setCreatedBy(ShiroUtils.getLoginName());//创建人
                     detail.setLastUpdatedBy(ShiroUtils.getLoginName());//创建时间
-                    inventoryDetailService.save(detail);
-                } else {
+                    if (!inventoryDetailService.save(detail))
+                        throw new ServiceException("添加库存明细失败");
+                    }
+                 else {
                     detail.setQty(detail.getQty().add(DataUtils.getBigDecimal(map.get("qty"))));
                     detail.setLastUpdatedBy(ShiroUtils.getLoginName());
                     LambdaUpdateWrapper<InventoryDetail> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
-                    lambdaUpdateWrapper.eq(InventoryDetail::getId, DataUtils.getInteger(map.get("receiptDetailId")));
-                    inventoryDetailService.update(detail, lambdaUpdateWrapper);
+                    lambdaUpdateWrapper.eq(InventoryDetail::getId,DataUtils.getInteger(map.get("receiptDetailId")));
+                    if (!inventoryDetailService.update(detail, lambdaUpdateWrapper))
+                        throw new ServiceException("更新入库单明细失败");
+
                 }
                 //记录库存交易记录
                 InventoryTransaction inventoryTransaction = new InventoryTransaction();
@@ -393,28 +412,49 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
                 inventoryTransaction.setBillDetailId(DataUtils.getInteger(map.get("receiptDetailId")));
                 inventoryTransaction.setBatch(DataUtils.getString(map.get("batch")));
                 inventoryTransaction.setLot(DataUtils.getString(map.get("lot")));
-                inventoryTransaction.setManufactureDate(DataUtils.getDateTime(map.get("manufactureDate")));
-                inventoryTransaction.setExpirationDate(DataUtils.getDateTime(map.get("expirationDate")));
+                inventoryTransaction.setManufactureDate(new SimpleDateFormat("yyyy-MM-dd").parse(map.get("manufactureDate").toString()));//生产日期
+//                inventoryTransaction.setExpirationDate(DataUtils.getDateTime(map.get("expirationDate")));
                 inventoryTransaction.setInventorySts(DataUtils.getString((map.get("inventorySts"))));
                 inventoryTransaction.setTaskQty(DataUtils.getInteger(map.get("qty")));
                 inventoryTransaction.setCreated(new Date());
                 inventoryTransaction.setCreatedBy(ShiroUtils.getLoginName());
-                inventoryTransactionService.save(inventoryTransaction);
+                if (!inventoryTransactionService.save(inventoryTransaction))
+                    throw new ServiceException("新增库存记录失败");
                 //修改任务明细的状态为完成
                 TaskDetail taskDetail = new TaskDetail();
                 taskDetail.setStatus(100);
                 taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
                 taskDetail.setAgingDate(new Date());   //入库时间
                 LambdaUpdateWrapper<TaskDetail> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
-                lambdaUpdateWrapper.eq(TaskDetail::getTaskId, DataUtils.getInteger(map.get("taskDetailId")));
+                lambdaUpdateWrapper.eq(TaskDetail::getTaskId,task.getId());
                 taskDetailService.update(taskDetail, lambdaUpdateWrapper);
-                //修改入库单的状态
-                ReceiptHeader receiptHeader = new ReceiptHeader();
-                receiptHeader.setFirstStatus(100);
-                receiptHeader.setLastStatus(100);
-                LambdaUpdateWrapper<ReceiptHeader> receiptHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate();
-                receiptHeaderLambdaUpdateWrapper.eq(ReceiptHeader::getId, DataUtils.getInteger(map.get("receiptId")));
-                receiptHeaderService.update(receiptHeader, receiptHeaderLambdaUpdateWrapper);
+                if ( !taskDetailService.update(taskDetail, lambdaUpdateWrapper)){
+                    throw new ServiceException("修改入库单明细失败");
+                }
+//                //修改入库单的状态
+//                ReceiptHeader receiptHeader = new ReceiptHeader();
+//                receiptHeader.setFirstStatus(100);
+//                receiptHeader.setLastStatus(100);
+//                LambdaUpdateWrapper<ReceiptHeader> receiptHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate();
+//                receiptHeaderLambdaUpdateWrapper.eq(ReceiptHeader::getId, DataUtils.getInteger(map.get("receiptId")));
+//                if (!receiptHeaderService.update(receiptHeader, receiptHeaderLambdaUpdateWrapper)){
+//                    throw new ServiceException("修改入库单失败");
+//                }
+//                //修改任务明细的状态为完成
+//                TaskDetail taskDetail = new TaskDetail();
+//                taskDetail.setStatus(100);
+//                taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
+//                taskDetail.setAgingDate(new Date());   //入库时间
+//                LambdaUpdateWrapper<TaskDetail> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
+//                lambdaUpdateWrapper.eq(TaskDetail::getTaskId, DataUtils.getInteger(map.get("taskDetailId")));
+//                taskDetailService.update(taskDetail, lambdaUpdateWrapper);
+//                //修改入库单的状态
+//                ReceiptHeader receiptHeader =new ReceiptHeader();
+//                receiptHeader.setFirstStatus(100);
+//                receiptHeader.setLastStatus(100);
+//                LambdaUpdateWrapper<ReceiptHeader> receiptHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate();
+//                receiptHeaderLambdaUpdateWrapper.eq(ReceiptHeader::getId, DataUtils.getInteger(map.get("receiptId")));
+//                receiptHeaderService.update(receiptHeader, receiptHeaderLambdaUpdateWrapper);
 
                 //修改任务主表状态,因为立库任务表单头只对应一个货箱,表单详情的任务会同时完成
                 task.setStatus(100);
@@ -422,25 +462,43 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
                 task.setLastUpdated(new Date());
                 LambdaUpdateWrapper<TaskHeader> taskHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate();
                 taskHeaderLambdaUpdateWrapper.eq(TaskHeader::getId, task.getId());
-                taskHeaderService.update(task, taskHeaderLambdaUpdateWrapper);
+                if (!taskHeaderService.update(task, taskHeaderLambdaUpdateWrapper))
+                    throw new ServiceException("更新任务主表失败");
+
                 //修改库位状态和对应的容器
                 Location location = new Location();
                 location.setContainerCode(task.getContainerCode());
                 location.setStatus("empty");
                 LambdaUpdateWrapper<Location> locationLambdaUpdateWrapper = Wrappers.lambdaUpdate();
                 locationLambdaUpdateWrapper.eq(Location::getCode, task.getToLocation());
-                locationService.update(location, locationLambdaUpdateWrapper);
+                if (!locationService.update(location, locationLambdaUpdateWrapper))
+                    throw new ServiceException("更新库位失败");
+
                 //修改容器状态和对应的库位
                 Container container = new Container();
                 container.setLocationCode(task.getToLocation());
                 container.setStatus("some");
-                //修改组盘表状态为20
+                if (!containerService.save(container)){
+                    throw new ServiceException("更新容器失败");
+                }
+               //修改组盘表状态为20
                 ReceiptContainerDetail receiptContainerDetail = new ReceiptContainerDetail();
                 receiptContainerDetail.setStatus(20);
+                receiptContainerDetail.setProcessStamp("0");
+                receiptContainerDetail.setLastUpdated(new Date());
+                receiptContainerDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
                 LambdaUpdateWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate();
                 receiptContainerDetailLambdaUpdateWrapper.eq(ReceiptContainerDetail::getReceiptId, DataUtils.getInteger(map.get("receiptId")));
-                receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaUpdateWrapper);
+                if (! receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaUpdateWrapper))
+                    throw new ServiceException("更新组盘状态失败");
+                //修改入库明细
+                ReceiptDetail receiptDetail = receiptDetailService.queryflow(receiptDetailService.getById(DataUtils.getInteger(map.get("receiptDetailId"))));
+                if (!receiptDetailService.updateById(receiptDetail)){
+                    throw new ServiceException("更新状态失败");
+                }
+                receiptDetailService.updateReceiptHeaderLastStatus(receiptDetail.getReceiptId());
             }
+
         }
         return AjaxResult.success("完成入库任务");
     }
@@ -847,7 +905,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
 
     /**
      * 创建上架任务
-     *
      * @param ids
      * @return
      */
@@ -932,5 +989,115 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
 
 
 
+    /**
+     *
+     * 完成出库任务
+     * */
+    @Override
+    public void completeShipmentTask(TaskHeader task) {
+        //获取所有子任务
+        TaskDetail condition = new TaskDetail();
+        condition.setTaskId(task.getId());
+        LambdaQueryWrapper<TaskDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(condition);
+        List<TaskDetail> taskDetails = taskDetailService.list(lambdaQueryWrapper);
+        List<Integer> shipmentHeadIds = new ArrayList<>();
+        for(TaskDetail taskDetail : taskDetails){
+            if(taskDetail.getStatus()<20){
+                //获取出库子货箱
+                ShipmentContainerDetail shipmentContainerDetail = shipmentContainerDetailService.getById(taskDetail.getAllocationId());
+                //取出子单据
+                ShipmentDetail shipmentDetail = shipmentDetailService.getById(taskDetail.getBillDetailId());
+                //暂存id,为更新单据状态准备
+                shipmentHeadIds.add(shipmentDetail.getShipmentId());
+                //获取对应库存记录
+                InventoryDetail inventoryDetail = inventoryDetailService.getById(taskDetail.getToInventoryId());
+                if (inventoryDetail == null)  {
+                    throw new ServiceException("任务明细对应的库存ID【" + taskDetail.getToInventoryId().toString() + "】不存在!");
+                }
+                BigDecimal orignalQty = inventoryDetail.getQty();
+                //扣减库存
+                inventoryDetail.setTaskQty(inventoryDetail.getTaskQty().subtract(taskDetail.getQty()));
+                inventoryDetail.setQty(inventoryDetail.getQty().subtract(taskDetail.getQty()));
+                if(inventoryDetail.getQty().compareTo(new BigDecimal("0"))==0 && inventoryDetail.getTaskQty().compareTo(new BigDecimal("0"))==0){
+                    //如果库存没有了,就删除这个库存
+                    inventoryDetailService.removeById(inventoryDetail.getId());
+                }else {
+                    //否则更新这个库存
+                    inventoryDetailService.updateById(inventoryDetail);
+                }
+                //设置子任务状态为已执行
+                taskDetail.setStatus(100);
+                taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
+                taskDetail.setLastUpdated(new Date());   //完成时间
+                taskDetailService.updateById(taskDetail);
+                //记录库存交易记录
+                InventoryTransaction inventoryTransaction = new InventoryTransaction();
+                inventoryTransaction.setWarehouseCode(task.getWarehouseCode());
+                inventoryTransaction.setCompanyCode(shipmentDetail.getCompanyCode());
+                inventoryTransaction.setLocationCode(inventoryDetail.getLocationCode());
+                inventoryTransaction.setContainerCode(inventoryDetail.getContainerCode());
+                inventoryTransaction.setTransactionType(20);
+                inventoryTransaction.setMaterialCode(shipmentDetail.getMaterialCode());
+                //inventory.setMaterialName(DataUtils.getString(taskDetail.getMaterialName()));//物料名称
+                inventoryTransaction.setBillCode(taskDetail.getBillCode());
+                inventoryTransaction.setBillDetailId(shipmentDetail.getId());
+                inventoryTransaction.setBatch(shipmentDetail.getBatch());
+                inventoryTransaction.setLot(shipmentDetail.getLot());
+                inventoryTransaction.setManufactureDate(shipmentDetail.getManufactureDate());
+                inventoryTransaction.setExpirationDate(shipmentDetail.getExpirationDate());
+                inventoryTransaction.setInventorySts(inventoryDetail.getInventorySts());
+                //这里取反,更符合出库的语义,同时方便对记录进行统计
+                inventoryTransaction.setTaskQty(taskDetail.getQty().intValue());
+//                inventoryTransaction.setCostPrice(shipmentDetail.);
+                inventoryTransaction.setCreated(null);
+                inventoryTransaction.setCreatedBy(ShiroUtils.getLoginName());
+                inventoryTransactionService.save(inventoryTransaction);
+//                //更新单据状态
+//                shipmentHeaderService.updateShipmentStatus(shipmentHeader.getId());
+            }
+        }
+        //设置主任务为已执行
+        task.setStatus(100);
+        task.setLastUpdatedBy(ShiroUtils.getLoginName());
+        task.setLastUpdated(new Date());
+        taskHeaderService.updateById(task);
+        //将库位状态改为空闲,如果是整出的对应的容器也清空
+        Location locationRecord = new Location();
+        locationRecord.setStatus("empty");
+        if(task.getTaskType()==300) {
+            locationRecord.setContainerCode("");
+        }
+        LambdaUpdateWrapper<Location> locationLambdaUpdateWrapper = Wrappers.lambdaUpdate();
+                locationLambdaUpdateWrapper.eq(Location::getCode,task.getToLocation());
+        locationService.update(locationLambdaUpdateWrapper);
+        //如果是整出,删掉这个库位上的这个托盘,否则更改托盘状态
+        Container containerRecord = new Container();
+        if(task.getTaskType()==300) {
+            containerService.updateLocationCodeAndStatus(task.getContainerCode(),"","empty");
+        }
+        else{
+            //查询是否存在关联的库存,入如果没有就修改容器状态为empty
+            InventoryDetail inventoryCondition = new InventoryDetail();
+            inventoryCondition.setLocationCode(task.getToLocation());
+            LambdaQueryWrapper<InventoryDetail> inventoryDetaillambdaQueryWrapper = Wrappers.lambdaQuery();
+            inventoryDetaillambdaQueryWrapper.eq(InventoryDetail::getLocationCode,task.getToLocation());
+            List<InventoryDetail> detailList= inventoryDetailService.list();
+            //库存查询不到该容器就把容器状态改为可用
+            if (detailList.size()<1) {
+                Container container =new Container();
+                container.setCode(task.getToLocation());
+                condition.setToLocation("");
+               LambdaUpdateWrapper<Container> containerLambdaUpdateWrapper = Wrappers.lambdaUpdate();
+               containerLambdaUpdateWrapper.eq(Container::getCode,task.getToLocation());
+               containerService.update(containerLambdaUpdateWrapper);
+            }
+        }
+//        //设置出库货箱状态为拣货任务完成
+//        shipmentContainerHeaderService.resetStatusShipmentContainer(task.getAllocationHeadId(),(short)20);
+       // 最后更新单据状态
+        shipmentHeadIds.stream().distinct().forEach(t->shipmentHeaderService.updateShipmentStatus(t));
+
+    }
+
 
 }
diff --git a/src/main/resources/mybatis/inventory/AdjustHeaderMapper.xml b/src/main/resources/mybatis/inventory/AdjustHeaderMapper.xml
index 313341b..8da3b74 100644
--- a/src/main/resources/mybatis/inventory/AdjustHeaderMapper.xml
+++ b/src/main/resources/mybatis/inventory/AdjustHeaderMapper.xml
@@ -25,4 +25,12 @@
     id, code, warehouseCode, companyCode, problemType, cycleCountCode, checkCode,
     referCode, referReason, createdBy, created, version, userDef1, userDef2, userDef3, processStamp
   </sql>
+
+    <select id="getLastCode" resultType="java.lang.String">
+        SELECT code FROM adjust_header ORDER BY id DESC LIMIT 1
+    </select>
+
+
+
+
 </mapper>
\ No newline at end of file
diff --git a/src/main/resources/mybatis/inventory/CycleCountHeaderMapper.xml b/src/main/resources/mybatis/inventory/CycleCountHeaderMapper.xml
index 84fe6ef..e25f9f4 100644
--- a/src/main/resources/mybatis/inventory/CycleCountHeaderMapper.xml
+++ b/src/main/resources/mybatis/inventory/CycleCountHeaderMapper.xml
@@ -9,7 +9,7 @@
     <result column="masterCode" jdbcType="VARCHAR" property="masterCode" />
     <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" />
     <result column="companyCode" jdbcType="VARCHAR" property="companyCode" />
-    <result column="countType" jdbcType="INTEGER" property="countType" />
+    <result column="countType" jdbcType="VARCHAR" property="countType" />
     <result column="statusCyc" jdbcType="INTEGER" property="statusCyc" />
     <result column="countAttribute" jdbcType="INTEGER" property="countAttribute" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
@@ -41,4 +41,11 @@
     releasedAt, closedBy, closedAt, created, createdBy, lastUpdated, lastUpdatedBy, version, 
     userDef1, userDef2, userDef3, verifyBy, sourceCode, uploadTime, uploadStatus
   </sql>
+
+    <select id="getLastCode" resultType="java.lang.String">
+        SELECT masterCode FROM cycle_count_header ORDER BY id DESC LIMIT 1
+    </select>
+
+
+
 </mapper>
\ No newline at end of file
diff --git a/src/main/resources/templates/inventory/cycleCountDetail/cycleCountDetail.html b/src/main/resources/templates/inventory/cycleCountDetail/cycleCountDetail.html
index 39dc3a4..8dea881 100644
--- a/src/main/resources/templates/inventory/cycleCountDetail/cycleCountDetail.html
+++ b/src/main/resources/templates/inventory/cycleCountDetail/cycleCountDetail.html
@@ -116,7 +116,7 @@
     var prefix = ctx + "inventory/cycleCountDetail";
     var prefix_head = ctx + "inventory/cycleCountHeader";
     var remove_url= prefix + "/remove";
-    var datas = [[${@dict.getType('cyclecountStatus')}]];
+    var cyclecountStatus = [[${@dict.getType('cyclecountStatus')}]];
     var inventoryStatus=[[${@dict.getType('inventoryStatus')}]];
     var created ;
 
@@ -287,9 +287,9 @@
                     field: 'enableStatus',
                     title: '盘点明细状态',
                     formatter: function(value, row, index) {
-                        return $.table.selectDictLabel(datas, value);
+                        return $.table.selectDictLabel(cyclecountStatus, value);
                     },
-                    sortable:true
+                    visible: true
                 },
                 {
                     field: 'processStamp',
diff --git a/src/main/resources/templates/inventory/cycleCountHeader/add.html b/src/main/resources/templates/inventory/cycleCountHeader/add.html
index f130fc4..d12cf2a 100644
--- a/src/main/resources/templates/inventory/cycleCountHeader/add.html
+++ b/src/main/resources/templates/inventory/cycleCountHeader/add.html
@@ -4,34 +4,82 @@
 <head th:include="include :: header"></head>
 <body class="white-bg">
     <div class="wrapper wrapper-content animated fadeInRight ibox-content">
-        <form class="form-horizontal m" id="form-cyclecountHeader-add">
+        <form class="form-horizontal m" id="form-cycleCountHeader-add">
 			<div class="form-group">
 				<label class="col-sm-3 control-label">盘点类型:</label>
 				<div class="col-sm-8">
-					<select name="type" id="type" class="form-control m-b"  th:with="firstStatus=${@dict.getType('cyclecountType')}">
+					<select name="countType" id="countType" class="form-control m-b"  th:with="firstStatus=${@dict.getType('cyclecountType')}">
 					<option th:each="e : ${firstStatus}" th:text="${e['dictLabel']}"
 							th:value="${e['dictValue']}"></option>
 					</select>
 				</div>
 			</div>
 			<div class="form-group">
-				<label class="col-sm-3 control-label">货主:</label>
-				<div class="col-sm-8">
-					<select id="company" name="company" class="form-control m-b" th:with="list=${@company.selectCompanyByCurrentUserId()}">
-						<option th:each="item : ${list}" th:text="${item['name']}" th:value="${item['id']}" th:attr = " code = ${item['code']}"></option>
-					</select>
-				</div>
+				<label class="col-sm-3 control-label">原始盘点内部号:</label>
+                <div class="col-sm-8">
+                    <input id="countOrderId" name="countOrderId" class="form-control" type="text">
+                </div>
 			</div>
 			<div class="form-group">	
-				<label class="col-sm-3 control-label">备注:</label>
+				<label class="col-sm-3 control-label">盘点轮次:</label>
 				<div class="col-sm-8">
-					<input id="userDef1" name="remark" class="form-control" type="text">
+					<input id="round" name="round" class="form-control" type="text">
 				</div>
 				<!--th:checked="true" 状态按钮默认为启用 $("input[name='enable']").is(':checked')-->
 				<!--<div>-->
 					<!--<input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="enable" name="enable">-->
 				<!--</div>-->
 			</div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">货主:</label>
+                <div class="col-sm-8">
+                    <input id="companyCode" name="companyCode" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">总货位数:</label>
+                <div class="col-sm-8">
+                    <input id="totalLocs" name="totalLocs" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">总物料数:</label>
+                <div class="col-sm-8">
+                    <input id="totalItems" name="totalItems" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">指定区域:</label>
+                <div class="col-sm-8">
+                    <input id="zoneCode" name="zoneCode" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">库位条件(模糊):</label>
+                <div class="col-sm-8">
+                    <input id="locationFilter" name="locationFilter" class="form-control" type="text">
+                </div>
+            </div>
+            <div class="form-group">
+                <label class="col-sm-3 control-label">源盘点单号:</label>
+                <div class="col-sm-8">
+                    <input id="sourceCode" name="sourceCode" class="form-control" type="text">
+                </div>
+            </div>
+
+            <!--<div class="form-group">
+                <label class="col-sm-3 control-label">原始盘点内部号:</label>
+                <div class="col-sm-8">
+                    <input id="countOrderId" name="remark" class="form-control" type="text">
+                </div>
+            </div>-->
+            <div class="form-group">
+                <label class="col-sm-3 control-label">备注:</label>
+                <div class="col-sm-8">
+                    <input id="remark" name="remark" class="form-control" type="text">
+                </div>
+            </div>
+
 			<div class="form-group">
 				<div class="form-control-static col-sm-offset-9">
 					<button type="submit" class="btn btn-primary">提交</button>
@@ -42,21 +90,32 @@
 	</div>
     <div th:include="include::footer"></div>
     <script type="text/javascript">
-		var prefix = ctx + "inventory/cyclecountHeader"
-		$("#form-cyclecountHeader-add").validate({
+		var prefix = ctx + "inventory/cycleCountHeader"
+		$("#form-cycleCountHeader-add").validate({
 			rules:{
-                // code:{
-				// 	required:true,
-				// },
-				type:{
+                companyCode:{
+					required:true,
+				},
+                /*countType:{
                     required:true
-				}
+				},*/
+                totalLocs:{
+                    required:false,
+                    digits:true,
+                    min:0
+                },
+                totalItems:{
+                    required:false,
+                    digits:true,
+                    min:0
+                },
+
 			},
 			submitHandler: function(form) {
-                var tableValue = $("#form-cyclecountHeader-add").serialize();
-                tableValue = formValueReplace(tableValue, "enable", true);
-                tableValue = formValueReplace(tableValue, "companyId", $("#company option:selected").val());
-                tableValue = formValueReplace(tableValue, "companyCode", $("#company option:selected").attr("code"));
+                var tableValue = $("#form-cycleCountHeader-add").serialize();
+                // tableValue = formValueReplace(tableValue, "enable", true);
+                // tableValue = formValueReplace(tableValue, "companyId", $("#company option:selected").val());
+                // tableValue = formValueReplace(tableValue, "companyCode", $("#company option:selected").attr("code"));
                 $.operate.save(prefix + "/add", tableValue);
             }
 		});
diff --git a/src/main/resources/templates/inventory/cycleCountHeader/cycleCountHeader.html b/src/main/resources/templates/inventory/cycleCountHeader/cycleCountHeader.html
index 05ced27..6182cb4 100644
--- a/src/main/resources/templates/inventory/cycleCountHeader/cycleCountHeader.html
+++ b/src/main/resources/templates/inventory/cycleCountHeader/cycleCountHeader.html
@@ -96,8 +96,8 @@
     var prefix = ctx + "inventory/cycleCountHeader";
     var datas = [[${@dict.getType('sys_normal_disable')}]];
     var types = [[${@dict.getType('cyclecountType')}]];
-    var status2 = [[${@dict.getType('cyclecountStatus')}]];
-
+    var cyclecountStatus = [[${@dict.getType('cyclecountStatus')}]];
+    var ifs = [[${@dict.getType('false_and_true')}]];
     $(function () {
         var options = {
             url: prefix + "/list",
@@ -161,19 +161,23 @@
                 },
                 {
                     field: 'releasedBy',
-                    title: '释放人'
+                    title: '释放人',
+                    visible: false
                 },
                 {
                     field: 'releasedAt',
-                    title: '释放时间'
+                    title: '释放时间',
+                    visible: false
                 },
                 {
                     field: 'closedBy',
-                    title: '关闭人'
+                    title: '关闭人',
+                    visible: false
                 },
                 {
                     field: 'closedAt',
-                    title: '关闭时间'
+                    title: '关闭时间',
+                    visible: false
                 },
                 {
                     field: 'countType',
@@ -185,25 +189,29 @@
                     sortable: true
                 },
                 {
-                    field: 'verifyBy',
-                    title: '审核人'
-                },
-                {
                     field: 'statusCyc',
-                    title: '盘点状态',
-                    align: 'center',
-                    formatter: function (value, row, index) {
-                        return $.table.selectDictLabel(status2, value);
+                    title: '盘点主单状态',
+                    formatter: function(value, row, index) {
+                        return $.table.selectDictLabel(cyclecountStatus, value);
                     },
-                    sortable: true
+                    visible: true
+                },
+                {
+                    field: 'verifyBy',
+                    title: '审核人'
                 },
                 {
                     field: 'uploadTime',
-                    title: '上传时间'
+                    title: '上传时间',
+                    visible: false
                 },
                 {
                     field: 'uploadStatus',
-                    title: '上传状态'
+                    title: '上传状态',
+                    align: 'center',
+                    formatter: function (value, row, index) {
+                        return $.table.selectDictLabel(ifs, value);
+                    }
                 },
                 {
                     field: 'version',
@@ -266,10 +274,9 @@
 
                         actions.push('<a class="btn btn-warning btn-xs " href="#" onclick="goAdjust(\'' + row.id + '\')"><i class="fa fa-gbp"></i>生成差异单</a> ');
 
-                        actions.push('<a class="btn btn-info btn-xs " href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+                        //actions.push('<a class="btn btn-info btn-xs " href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                         actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> ');
-                        //actions.push('<a style="background: #b5bdc0" class="btn btn-default btn-xs " href="#" onclick="detail(\'' + row.code + '\',\'' + row.code + '\')"><i class="fa fa-list-ul"></i>明细</a>');
-                        return actions.join('');
+                         return actions.join('');
                     }
                 }]
         };
diff --git a/src/main/resources/templates/task/taskDetail/taskDetail.html b/src/main/resources/templates/task/taskDetail/taskDetail.html
index 81ab149..0479d47 100644
--- a/src/main/resources/templates/task/taskDetail/taskDetail.html
+++ b/src/main/resources/templates/task/taskDetail/taskDetail.html
@@ -72,12 +72,12 @@
                     sortable:true
 				},
 				{
-					field : 'sourceLocation', 
+					field : 'fromLocation',
 					title : '源库位',
                     sortable:true
 				},
 				{
-					field : 'destinationLocation', 
+					field : 'toLocation',
 					title : '目的库位',
                     sortable:true
 				},
diff --git a/src/main/resources/templates/task/taskHeader/taskHeader.html b/src/main/resources/templates/task/taskHeader/taskHeader.html
index a18ca42..5b4af3e 100644
--- a/src/main/resources/templates/task/taskHeader/taskHeader.html
+++ b/src/main/resources/templates/task/taskHeader/taskHeader.html
@@ -32,7 +32,7 @@
 									</li>
 
 									<li>
-										库位编号:<input type="text" name="locationCode"/>
+										库位编号:<input type="text" name="toLocation"/>
 									</li>
 									<li class="time" style="height: 30px">
 										<label>创建时间: </label>
@@ -171,7 +171,7 @@
 
 				},
                  {
-                        field : 'locationCode',
+                        field : 'toLocation',
                         title : '库位号',
                         visible:true
                    },
@@ -234,7 +234,7 @@
                             actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>取消</a> ');
                             actions.push('<a class="btn btn-primary btn-xs ' + completeFlag + '" href="#" onclick="complete(\'' + row.id + '\')"><i class="fa fa-check"></i>完成</a>');
                         }
-						if (row.status >=10)  {
+						if (row.status >= 10 && row.status < 100)  {
 							actions.push('<a class="btn btn-primary btn-xs ' + completeFlag + '" href="#" onclick="complete(\'' + row.id + '\')"><i class="fa fa-check"></i>完成</a>');
 						}
                         return actions.join('');