diff --git a/ant-design-vue-jeecg/src/components/jeecgbiz/JButtonBizComponent/JSelectBizComponentModal.vue b/ant-design-vue-jeecg/src/components/jeecgbiz/JButtonBizComponent/JSelectBizComponentModal.vue
index c67d216..c216f4d 100644
--- a/ant-design-vue-jeecg/src/components/jeecgbiz/JButtonBizComponent/JSelectBizComponentModal.vue
+++ b/ant-design-vue-jeecg/src/components/jeecgbiz/JButtonBizComponent/JSelectBizComponentModal.vue
@@ -331,6 +331,7 @@ export default {
             that.$emit('ok');
             that.model.containerCode = '';
             that.model.toPortCode = '';
+            that.close();
           } else {
             that.$message.warning(res.message);
           }
diff --git a/ant-design-vue-jeecg/src/components/jeecgbiz/JSelectMultiCycleCount.vue b/ant-design-vue-jeecg/src/components/jeecgbiz/JSelectMultiCycleCount.vue
index 69c5e24..2f271ab 100644
--- a/ant-design-vue-jeecg/src/components/jeecgbiz/JSelectMultiCycleCount.vue
+++ b/ant-design-vue-jeecg/src/components/jeecgbiz/JSelectMultiCycleCount.vue
@@ -8,6 +8,7 @@
     v-on="$listeners"
     v-bind="attrs"
   />
+
 </template>
 
 <script>
diff --git a/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountDetailList.vue b/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountDetailList.vue
index 50c8ec3..f5e197a 100644
--- a/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountDetailList.vue
+++ b/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountDetailList.vue
@@ -14,38 +14,14 @@
     <div class="table-operator">
       <j-select-multi-cycle-count  :query-config="selectUserQueryConfig"/>
       <a-button type="primary" icon="download" @click="handleExportXls('盘点明细表')">导出</a-button>
-      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
-        <a-button type="primary" icon="import">导入</a-button>
-      </a-upload>
       <!-- 高级查询区域 -->
-      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
-      <a-dropdown v-if="selectedRowKeys.length > 0">
-        <a-menu slot="overlay">
-          <a-menu-item key="1" @click="batchDel">
-            <a-icon type="delete"/>
-            <span>删除</span>
-          </a-menu-item>
-        </a-menu>
-        <a-button>
-          <span>批量操作</span>
-          <a-icon type="down"/>
-        </a-button>
-      </a-dropdown>
+
     </div>
     <!-- 操作按钮区域 end -->
 
     <!-- table区域 begin -->
     <div>
 
-      <a-alert type="info" showIcon style="margin-bottom: 16px;">
-        <template slot="message">
-          <span>已选择</span>
-          <a style="font-weight: 600;padding: 0 4px;">{{ selectedRowKeys.length }}</a>
-          <span>项</span>
-          <a style="margin-left: 24px" @click="onClearSelected">清空</a>
-        </template>
-      </a-alert>
-
       <a-table
         ref="table"
         size="middle"
@@ -66,7 +42,7 @@
         <!-- 内嵌table区域 begin -->
         <template slot="expandedRowRender" slot-scope="record">
           <a-tabs tabPosition="top">
-            <a-tab-pane tab="盘点容器明细表" key="cycleCountDetailChild" forceRender>
+            <a-tab-pane tab="物料详情表" key="cycleCountDetailChild" forceRender>
               <cycle-count-detail-child-sub-table :record="record"/>
             </a-tab-pane>
           </a-tabs>
@@ -100,18 +76,11 @@
         </template>
 
         <template slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
+          <a @click="handleEdit(record)">生成盘点任务</a>
           <a-divider type="vertical"/>
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
+          <a-popconfirm title="确定删除吗?" @confirm="handleDelete(record.id)">
+            <a>删除</a>
+          </a-popconfirm>
 
         </template>
 
@@ -203,7 +172,7 @@
           {
             title: '库存状态',
             align: 'center',
-            dataIndex: 'inventorySts',
+            dataIndex: 'inventorySts_dictText',
           },
           {
             title: '系统数量',
@@ -238,7 +207,7 @@
           {
             title: '状态',
             align: 'center',
-            dataIndex: 'enableStatus',
+            dataIndex: 'enableStatus_dictText',
           },
           {
             title: '操作',
diff --git a/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue b/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue
index 17672d2..08862a8 100644
--- a/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue
+++ b/ant-design-vue-jeecg/src/views/system/stocktaking/CycleCountHeaderList.vue
@@ -46,7 +46,15 @@
         :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         class="j-table-force-nowrap"
         @change="handleTableChange">
-
+        <!-- 内嵌table区域 begin -->
+        <template slot="expandedRowRender" slot-scope="record">
+          <a-tabs tabPosition="top">
+            <a-tab-pane tab="盘点明细" key="cycleCountHetailChild" forceRender>
+              <cycle-count-detail-list :record="record"/>
+            </a-tab-pane>
+          </a-tabs>
+        </template>
+        <!-- 内嵌table区域 end -->
         <span slot="companyCode" slot-scope="companyCode">
           <a-tag :key="companyCode" color=blue>
             {{ solutionCompany(companyCode) }}
@@ -114,12 +122,14 @@
   import {getCompanyList} from '@/api/api'
   import {getCountTypeList} from '@/api/api'
   import CycleCountHeaderModal from './modules/CycleCountHeaderModal'
+  import CycleCountDetailList from "./CycleCountDetailList";
 
   export default {
     name: 'CycleCountHeaderList',
     mixins:[JeecgListMixin, mixinDevice],
     components: {
-      CycleCountHeaderModal
+      CycleCountHeaderModal,
+      CycleCountDetailList,
     },
     data () {
       return {
diff --git a/ant-design-vue-jeecg/src/views/system/stocktaking/subTables/CycleCountDetailChildSubTable.vue b/ant-design-vue-jeecg/src/views/system/stocktaking/subTables/CycleCountDetailChildSubTable.vue
index d6e2543..2340856 100644
--- a/ant-design-vue-jeecg/src/views/system/stocktaking/subTables/CycleCountDetailChildSubTable.vue
+++ b/ant-design-vue-jeecg/src/views/system/stocktaking/subTables/CycleCountDetailChildSubTable.vue
@@ -115,7 +115,7 @@
           {
             title: '明细状态',
             align: 'center',
-            dataIndex: 'childStatus',
+            dataIndex: 'childStatus_dictText',
           },
           {
             title: '库存明细ID',
diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java
index aebb3a4..64eb620 100644
--- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java
+++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/controller/CycleCountDetailController.java
@@ -11,6 +11,8 @@ import java.util.stream.Collectors;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+
+import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.jeecg.modules.wms.framework.controller.HuahengBaseController;
 import javax.servlet.http.HttpServletResponse;
 
@@ -20,6 +22,7 @@ import org.jeecg.modules.wms.framework.Convert;
 import org.jeecg.modules.wms.framework.controller.HuahengBaseController;
 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
+import org.jeecg.utils.HuahengJwtUtil;
 import org.jeecg.utils.StringUtils;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -172,6 +175,23 @@ public class CycleCountDetailController  extends HuahengBaseController {
 
 	}
 
+
+	 /**
+	  *   生成单条盘点任务
+	  *
+	  */
+	 @AutoLog(value = "生成单条盘点任务")
+	 @ApiOperation(value="生成单条盘点任务", notes="生成单条盘点任务")
+	 @PostMapping(value = "/createCycleCoutTaskByDetailId")
+	 public Result createCycleCoutTaskByDetailId(Integer cycleCoutdetailId, HttpServletRequest req){
+		 if(cycleCoutdetailId ==null){
+			 return Result.error("生成盘点任务时盘点明细ID不能为空!");
+		 }
+		 String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(req);
+		 return cycleCountDetailService.createCycleCoutTaskByDetailId(cycleCoutdetailId,warehouseCode);
+	 }
+
+
 	 /**
 	  *   添加盘点
 	  *
diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/entity/CycleCountDetail.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/entity/CycleCountDetail.java
index f36541a..f78001f 100644
--- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/entity/CycleCountDetail.java
+++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/entity/CycleCountDetail.java
@@ -57,7 +57,7 @@ public class CycleCountDetail implements Serializable {
 	/**库存明细头*/
 	@Excel(name = "库存明细头", width = 15)
     @ApiModelProperty(value = "库存明细头")
-    private Integer inventoryDetailId;
+    private Integer inventoryHeaderId;
 	/**库位*/
 	@Excel(name = "库位", width = 15)
     @ApiModelProperty(value = "库位")
@@ -69,19 +69,20 @@ public class CycleCountDetail implements Serializable {
 	/**库存状态*/
 	@Excel(name = "库存状态", width = 15)
     @ApiModelProperty(value = "库存状态")
+    @Dict(dicCode = "inventory_status")
     private String inventorySts;
 	/**系统数量*/
 	@Excel(name = "系统数量", width = 15)
     @ApiModelProperty(value = "系统数量")
-    private String systemQty;
+    private Integer systemQty;
 	/**实盘数量*/
 	@Excel(name = "实盘数量", width = 15)
     @ApiModelProperty(value = "实盘数量")
-    private String countedQty;
+    private Integer countedQty;
 	/**差异数量*/
 	@Excel(name = "差异数量", width = 15)
     @ApiModelProperty(value = "差异数量")
-    private String gapQty;
+    private Integer gapQty;
 	/**失败原因*/
 	@Excel(name = "失败原因", width = 15)
     @ApiModelProperty(value = "失败原因")
@@ -97,6 +98,7 @@ public class CycleCountDetail implements Serializable {
 	/**盘点明细状态*/
 	@Excel(name = "盘点明细状态", width = 15)
     @ApiModelProperty(value = "盘点明细状态")
+    @Dict(dicCode = "cyclecount_status")
     private Integer enableStatus;
 	/**创建人*/
     @ApiModelProperty(value = "创建人")
diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/entity/CycleCountDetailChild.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/entity/CycleCountDetailChild.java
index cc7c1fe..9c1f649 100644
--- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/entity/CycleCountDetailChild.java
+++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/entity/CycleCountDetailChild.java
@@ -40,7 +40,8 @@ public class CycleCountDetailChild implements Serializable {
 	/**盘点明细子单状态*/
 	@Excel(name = "盘点明细子单状态", width = 15)
     @ApiModelProperty(value = "盘点明细子单状态")
-    private String childStatus;
+    @Dict(dicCode = "cyclecount_status")
+    private Integer childStatus;
 	/**库位*/
 	@Excel(name = "库位", width = 15)
     @ApiModelProperty(value = "库位")
@@ -68,15 +69,15 @@ public class CycleCountDetailChild implements Serializable {
 	/**系统数量*/
 	@Excel(name = "系统数量", width = 15)
     @ApiModelProperty(value = "系统数量")
-    private String systemQty;
+    private Integer systemQty;
 	/**实盘数量*/
 	@Excel(name = "实盘数量", width = 15)
     @ApiModelProperty(value = "实盘数量")
-    private String countedQty;
+    private Integer countedQty;
 	/**差异数量*/
 	@Excel(name = "差异数量", width = 15)
     @ApiModelProperty(value = "差异数量")
-    private String gapQty;
+    private Integer gapQty;
 	/**库存明细id*/
 	@Excel(name = "库存明细id", width = 15)
     @ApiModelProperty(value = "库存明细id")
diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailService.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailService.java
index 3008e7e..6a8cf96 100644
--- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailService.java
+++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/ICycleCountDetailService.java
@@ -39,4 +39,7 @@ public interface ICycleCountDetailService extends IService<CycleCountDetail> {
 	public void delBatchMain (Collection<? extends Serializable> idList);
 
     Result stockDetailAdd(int taskId);
+
+	Result createCycleCoutTaskByDetailId(Integer cycleCoutdetailId,String warehouseCode);
+
 }
diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java
index 7b04f5a..d3b3ae2 100644
--- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java
+++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/stocktaking/cycleCountDetail/service/impl/CycleCountDetailServiceImpl.java
@@ -1,8 +1,11 @@
 package org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.impl;
 
+import com.aliyun.oss.ServiceException;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.wms.config.location.entity.Location;
+import org.jeecg.modules.wms.config.location.service.impl.LocationServiceImpl;
 import org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail;
 import org.jeecg.modules.wms.inventory.inventoryHeader.service.IInventoryDetailService;
 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetail;
@@ -10,11 +13,22 @@ import org.jeecg.modules.wms.stocktaking.cycleCountDetail.entity.CycleCountDetai
 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.mapper.CycleCountDetailChildMapper;
 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.mapper.CycleCountDetailMapper;
 import org.jeecg.modules.wms.stocktaking.cycleCountDetail.service.ICycleCountDetailService;
+import org.jeecg.modules.wms.stocktaking.cycleCountHeader.entity.CycleCountHeader;
+import org.jeecg.modules.wms.stocktaking.cycleCountHeader.service.impl.CycleCountHeaderServiceImpl;
+import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail;
+import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader;
+import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskDetailServiceImpl;
+import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskHeaderServiceImpl;
+import org.jeecg.utils.StringUtils;
+import org.jeecg.utils.constant.QuantityConstant;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
 import java.io.Serializable;
+import java.util.Date;
 import java.util.List;
 import java.util.Collection;
 
@@ -33,6 +47,17 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap
 	private CycleCountDetailChildMapper cycleCountDetailChildMapper;
 	@Autowired
 	private IInventoryDetailService inventoryDetailService;
+	@Resource
+	private CycleCountDetailChildServiceImpl cycleCountDetailChildServiceImpl;
+	@Resource
+	private LocationServiceImpl locationService;
+	@Resource
+	private TaskHeaderServiceImpl taskHeaderService;
+	@Resource
+	private TaskDetailServiceImpl taskDetailService;
+	@Resource
+	private CycleCountHeaderServiceImpl cycleCountHeaderService;
+
 
 	@Override
 	@Transactional
@@ -93,17 +118,184 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap
 		inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getInventoryHeaderId,taskId);
 		List<InventoryDetail> inventoryDetails = inventoryDetailService.list(inventoryDetailLambdaQueryWrapper);
 
-		CycleCountDetail cycleCountDetailChild = new CycleCountDetail();
-		cycleCountDetailChild.setCompanyCode(inventoryDetails.get(0).getCompanyCode());
-		cycleCountDetailChild.setContainerCode(inventoryDetails.get(0).getContainerCode());
-
+		CycleCountDetail cycleCountDetail = new CycleCountDetail();
+		cycleCountDetail.setCompanyCode(inventoryDetails.get(0).getCompanyCode());
+		cycleCountDetail.setInventoryHeaderId(inventoryDetails.get(0).getInventoryHeaderId());
+		cycleCountDetail.setLocationCode(inventoryDetails.get(0).getLocationCode());
+		cycleCountDetail.setContainerCode(inventoryDetails.get(0).getContainerCode());
+		cycleCountDetail.setInventorySts(inventoryDetails.get(0).getInventoryStatus());
+		cycleCountDetail.setSystemQty(inventoryDetails.size());
+		cycleCountDetail.setCountedQty(0);
+		cycleCountDetail.setGapQty(0);
+		cycleCountDetail.setEnableStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILD);
+		this.save(cycleCountDetail);
 
+		CycleCountDetailChild cycleCountDetailChild=new CycleCountDetailChild();
 		for(InventoryDetail inventoryDetail:inventoryDetails)
 		{
-
+//			cycleCountDetailChild.setCyclecountheadcode();
+			cycleCountDetailChild.setCycleCountDetailid(cycleCountDetail.getId());
+			cycleCountDetailChild.setChildStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILD);
+			cycleCountDetailChild.setLocationCode(inventoryDetail.getLocationCode());
+			cycleCountDetailChild.setContainerCode(inventoryDetail.getContainerCode());
+			cycleCountDetailChild.setMaterialCode(inventoryDetail.getMaterialCode());
+			cycleCountDetailChild.setMaterialName(inventoryDetail.getMaterialName());
+			cycleCountDetailChild.setMaterialSpec(inventoryDetail.getMaterialSpec());
+			cycleCountDetailChild.setMaterialUnit(inventoryDetail.getMaterialUnit());
+			cycleCountDetailChild.setSystemQty(inventoryDetail.getQty().intValue());
+			cycleCountDetailChild.setCountedQty(0);
+			cycleCountDetailChild.setGapQty(0);
+			cycleCountDetailChild.setInventoryDetaiId(inventoryDetail.getId());
+			cycleCountDetailChildServiceImpl.save(cycleCountDetailChild);
 		}
 
-		return Result.ok("添加成功");
+		return Result.OK();
+	}
+
+
+
+	/**
+	 * 生成单条盘点任务
+	 * @param cycleCoutDetailId
+	 * @return
+	 */
+	@Override
+	public Result createCycleCoutTaskByDetailId(Integer cycleCoutDetailId,String warehouseCode) {
+		/*任务主表中存在库位,在盘点明细中生成任务时,不同的容器生成不同的主任务*/
+		//校验有没有相同容器正在执行任务.
+//		CycleCountDetail cycleCountDetail = this.getById(cycleCoutDetailId);
+//		if(StringUtils.isNull(cycleCountDetail)){
+//			return Result.error("盘点明细ID错误,没有该条明细");
+//		}
+//		//查出明细的子单
+//		CycleCountDetailChild child = new CycleCountDetailChild();
+//		child.setCyclecountheadcode(cycleCountDetail.getCycleCountHeadCode());
+//		child.setCycleCountDetailid(cycleCountDetail.getId());
+//		LambdaQueryWrapper<CycleCountDetailChild> childLambdaQueryWrapper = Wrappers.lambdaQuery(child);
+//		List<CycleCountDetailChild> childList = cycleCountDetailChildServiceImpl.list(childLambdaQueryWrapper);
+//		if(childList.size() < 1){
+//			return Result.error("盘点明细没有子单");
+//		}
+//		Location location = locationService.getLocationByCode(
+//				cycleCountDetail.getLocationCode(), warehouseCode);
+//        /*if(!loc.getStatus().equals(QuantityConstant.STATUS_EMPTY)){
+//            return AjaxResult.error(cycleCountDetail.getLocationCode() + "库位不在空闲状态,请先完成其他任务,操作失败!");
+//        }*/
+//		if(StringUtils.isEmpty(location.getContainerCode())){
+//			return Result.error(cycleCountDetail.getLocationCode() + "库位中没有容器,操作失败!");
+//		}
+//		//生成任务同时锁定库位
+//		locationService.updateStatus(location.getCode(), QuantityConstant.STATUS_LOCATION_LOCK);
+//		//每个明细单生成一张主任务,子单就是任务明细。
+//		TaskHeader task = new TaskHeader();
+//		task.setWarehouseCode(warehouseCode);
+//		task.setCompanyCode(cycleCountDetail.getCompanyCode());
+//		task.setAllocationHeadId(cycleCountDetail.getId());//明细ID写入主任务
+//		if(location != null) {
+//			task.setZoneCode(location.getZoneCode());
+//		}
+//		task.setReferenceCode(cycleCountDetail.getCycleCountHeadCode()); //写入盘点主单号
+//		task.setInternalTaskType(QuantityConstant.TASK_INTENERTYPE_CYCLECOUNT);
+//		task.setTaskType(QuantityConstant.TASK_TYPE_CYCLECOUNT);
+//		task.setContainerCode(cycleCountDetail.getContainerCode());
+//		task.setStatus(QuantityConstant.TASK_STATUS_BUILD);
+//		task.setFromLocation(cycleCountDetail.getLocationCode());
+//		task.setPortGroup("P10");
+//		task.setBack(1);
+//		task.setSequenceNumber(1);
+//		task.setSequence(1);
+//		task.setShipmentOrder(System.currentTimeMillis());
+//
+//		task.setToLocation(cycleCountDetail.getLocationCode());
+//		task.setCreated(new Date());
+//		task.setCreatedBy(ShiroUtils.getLoginName());
+//		task.setLastUpdatedBy(ShiroUtils.getLoginName());
+//		task.setLastUpdated(new Date());
+//		if(taskHeaderService.save(task)){
+//			//锁定库位状态
+//			locationService.updateStatus(location.getContainerCode(), QuantityConstant.STATUS_LOCATION_LOCK);
+//			cycleCountDetail.setTaskHeaderId(task.getId()); //盘点明细修改状态task数据源
+//		}else{
+//			throw new ServiceException("盘点任务主表生成失败!");
+//		}
+//
+//		//写入任务细表
+//		TaskDetail taskDetail = new TaskDetail();
+//		for(CycleCountDetailChild item: childList){
+//
+//			taskDetail.setTaskId(task.getId());//主单ID
+//			taskDetail.setTaskType(task.getTaskType());
+//			taskDetail.setFromLocation(task.getFromLocation());
+//			taskDetail.setToLocation(task.getToLocation());
+//			taskDetail.setContainerCode(task.getContainerCode());
+//			taskDetail.setInternalTaskType(task.getTaskType());
+//			taskDetail.setWarehouseCode(task.getWarehouseCode());
+//			taskDetail.setBillCode(item.getCycleCountHeadCode());
+//			taskDetail.setBoxCode(item.getBoxCode());
+//			taskDetail.setBillDetailId(item.getCycleCountDetailId());
+//			taskDetail.setMaterialCode(item.getMaterialCode());
+//			taskDetail.setMaterialName(item.getMaterialName());
+//			taskDetail.setMaterialSpec(item.getMaterialSpec());
+//			taskDetail.setMaterialUnit(item.getMaterialUnit());
+//			taskDetail.setQty(item.getSystemQty());
+//			//taskDetail.setBatch(cycleCountDetail.getBatch());
+//			//taskDetail.setFromInventoryId(cycleCountDetail.getInventoryDetailId());
+//			//taskDetail.setLot(cycleCountDetail.getLot());
+//			//taskDetail.setProjectNo(cycleCountDetail.getProjectNo());
+//			taskDetail.setCompanyCode(cycleCountDetail.getCompanyCode());
+//			taskDetail.setCreated(new Date());
+//			taskDetail.setCreatedBy(ShiroUtils.getLoginName());
+//			taskDetail.setLastUpdated(new Date());
+//			taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
+//			if(taskDetailService.save(taskDetail) == false){
+//				throw new ServiceException("盘点任务明细生成失败!");
+//			}
+//			// 修改子单状态
+//			item.setChildStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILDTASK);
+//			cycleCountDetailChildServiceImpl.updateById(item);
+//		}
+//
+//		//修改细单状态
+//		cycleCountDetail.setTaskHeaderId(task.getId()); //盘点明细修改状态task数据源
+//		cycleCountDetail.setLastUpdated(new Date());
+//		cycleCountDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
+//		cycleCountDetail.setEnableStatus(QuantityConstant.CYCLECOUNT_STATUS_BUILDTASK);
+//		cycleCountDetail.setTaskHeaderId(task.getId());
+//		//cycleCountDetail.setTaskDetailId(taskDetail.getId());
+//		this.updateById(cycleCountDetail);
+//		//修改主单状态
+//		CycleCountHeader cycleCountHeader = new CycleCountHeader();
+//		cycleCountHeader.setCode(cycleCountDetail.getCycleCountHeadCode());
+//		cycleCountHeader.setWarehouseCode(cycleCountDetail.getWarehouseCode());
+//		//cycleCountHeader.setCompanyCode(cycleCountDetail.getCompanyCode());
+//		LambdaQueryWrapper<CycleCountHeader> lamb = Wrappers.lambdaQuery(cycleCountHeader);
+//		cycleCountHeader = cycleCountHeaderService.getOne(lamb);
+//		cycleCountHeader.setStatusCyc(QuantityConstant.CYCLECOUNT_STATUS_BUILDTASK);
+//		cycleCountHeaderService.updateById(cycleCountHeader);
+//
+//
+//
+//		LambdaQueryWrapper<InventoryDetail> lambdaQueryWrapper = Wrappers.lambdaQuery();
+//		lambdaQueryWrapper.eq(InventoryDetail::getContainerCode,task.getContainerCode());
+//		List<InventoryDetail> inventoryDetails = inventoryDetailService.list(lambdaQueryWrapper);
+//
+//		for (InventoryDetail inventoryDetail:inventoryDetails)
+//		{
+//
+//			if (StringUtils.isNotEmpty(inventoryDetail.getChipCode2()))
+//			{
+//				if (inventoryDetail.getChipCode2().equals("盘盈片码"))
+//				{
+//					inventoryDetail.setChipCode2("");
+//					inventoryDetailService.updateById(inventoryDetail);
+//				}
+//			}
+//		}
+//
+
+
+
+		return Result.ok("盘点任务生成成功");
 	}
 
 }