丁治程 před 1 rokem
rodič
revize
eefc2465ff

+ 4 - 0
module_kzks/src/main/java/org/jeecg/modules/Index/mapper/IndexKpiMapper.java

@@ -56,4 +56,8 @@ public interface IndexKpiMapper {
 
     List<IndexKpiCompletByDate> getZrbmHte(@Param("date") String date,@Param("departList") List<String> departList);
     List<IndexKpiCompletByDate> getZrbmYsk(@Param("date") String date,@Param("departList") List<String> departList);
+
+    List<IndexKpiCompletByDate> getFinallNum(@Param("finalDateYm") String finalDateYm,@Param("departList") List<String> departList);
+
+    List<IndexKpiCompletByDate> getNewNum(@Param("finalDateYm") String finalDateYm,@Param("departList") List<String> departList);
 }

+ 37 - 0
module_kzks/src/main/java/org/jeecg/modules/Index/mapper/xml/IndexKpiMapper.xml

@@ -136,4 +136,41 @@
 <!--        GROUP BY-->
 <!--            k.zrbm-->
 <!--    </select>-->
+
+
+    <select id="getFinallNum" resultType="org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate">
+        select e.depart as depart , sum(case when e.contractfpe != 0.00 then e.contractfpe * e.newJd else (e.EstimationCoat*10000)*e.newJd end) as contractAmount ,
+        sum(e.received) as received
+        from
+        (select k.taskno, k.zrbm as depart, k.contractfpe, k.EstimationCoat,(k.processPercent-m.processPercent)/100 as newJd,k.TaskMoney as received
+        from kzks_project_cost_huiji k
+        left join kzks_kpi_project_month m on k.taskno = m.taskno
+        where k.zrbm in
+        <foreach item='item' index='index' collection='departList' open='(' separator=',' close=')'>
+            #{item}
+        </foreach>
+        and m.ym =#{finalDateYm} ) e group by e.depart
+    </select>
+
+    <select id="getNewNum" resultType="org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate">
+        select zrbm as depart, sum((case when contractfpe != 0.00 then contractfpe * processPercent else (EstimationCoat*10000)*processPercent end) / 100.0) as contractAmount,
+        sum(TaskMoney) as received
+        from kzks_project_cost_huiji
+        where zrbm in
+        <foreach item='item' index='index' collection='departList' open='(' separator=',' close=')'>
+            #{item}
+        </foreach>
+        and taskno not in (
+        select k.taskno
+        from kzks_project_cost_huiji k
+        left join kzks_kpi_project_month m
+        on k.taskno = m.taskno
+        where k.zrbm in
+        <foreach item='item' index='index' collection='departList' open='(' separator=',' close=')'>
+            #{item}
+        </foreach>
+        and m.ym = #{finalDateYm}
+        ) group by zrbm
+    </select>
+
 </mapper>

+ 64 - 5
module_kzks/src/main/java/org/jeecg/modules/Index/service/impl/IndexKpiServiceImpl.java

@@ -4,6 +4,7 @@ import javassist.expr.NewArray;
 import org.apache.commons.collections4.comparators.NullComparator;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.RedisUtil;
 import org.jeecg.modules.Index.entity.kpi.IndexKpiCompletByDate;
 import org.jeecg.modules.Index.entity.kpi.IndexKpiDataDepart;
 import org.jeecg.modules.Index.entity.kpi.IndexKpiParamDto;
@@ -11,6 +12,7 @@ import org.jeecg.modules.Index.mapper.DepartKpiMapper;
 import org.jeecg.modules.Index.mapper.IndexKpiMapper;
 import org.jeecg.modules.Index.service.IndexKpiService;
 import org.jeecg.modules.Index.util.AuthMark;
+import org.jeecg.modules.Index.util.CacheKey;
 import org.jeecg.modules.Index.util.CommonMethod;
 import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
 import org.jeecg.modules.projectCost.service.IProjectCostService;
@@ -59,6 +61,9 @@ public class IndexKpiServiceImpl implements IndexKpiService {
     @SuppressWarnings("all")
     private IProjectCostService projectCostService;
 
+    @Autowired
+    private RedisUtil redisUtil;
+
     /**
      * 工具类
      * 根据日期字符串求上一个月的字符串
@@ -451,22 +456,76 @@ public class IndexKpiServiceImpl implements IndexKpiService {
                 return htereceivedXdbmYskMap;
             });
 
-            CompletableFuture<Void> future1 = CompletableFuture.allOf(getHtereceivedZrbmMapFuture, getHtereceivedZrbmLastMapFuture,getHtereceivedXdbmHteMapFuture,getHtereceivedXdbmYskMapFuture);
+            // 责任部门
+            CompletableFuture<Map<String, IndexKpiCompletByDate>> getHtereceivedZrbmFinalFuture = CompletableFuture.supplyAsync(() -> {
+                Map<String, IndexKpiCompletByDate> htereceivedZrbmFinalMap = new TreeMap<>();
+                List<IndexKpiCompletByDate> rList = new ArrayList<>();
+                List<IndexKpiCompletByDate> zrbmKpiList = (List<IndexKpiCompletByDate>) redisUtil.get(CacheKey.INDEX_ZRBM_FINAL);
+                if(zrbmKpiList != null && zrbmKpiList.size() > 0 && zrbmKpiList.get(0) != null){
+                    rList = zrbmKpiList;
+                }else {
+                    rList = indexKpiMapper.getFinallNum(finalDateLastYm, zrbmList);
+                    redisUtil.set(CacheKey.INDEX_ZRBM_FINAL,rList,1000L * 60 * 60 * 10);
+                }
+//                List<IndexKpiCompletByDate> list = indexKpiMapper.getFinallNum(finalDateLastYm, zrbmList);
+                for (IndexKpiCompletByDate i : rList){
+                    htereceivedZrbmFinalMap.put(i.getDepart(),i);
+                }
+                return htereceivedZrbmFinalMap;
+            });
+
+            CompletableFuture<Map<String, IndexKpiCompletByDate>> getHtereceivedZrbmNewFuture = CompletableFuture.supplyAsync(() -> {
+                Map<String, IndexKpiCompletByDate> htereceivedZrbmNewMap = new TreeMap<>();
+                List<IndexKpiCompletByDate> rList = new ArrayList<>();
+                List<IndexKpiCompletByDate> zrbmKpiList = (List<IndexKpiCompletByDate>)redisUtil.get(CacheKey.INDEX_ZRBM_NEW);
+                if (zrbmKpiList != null && zrbmKpiList.size() > 0 && zrbmKpiList.get(0) != null){
+                    rList = zrbmKpiList;
+                }else {
+                    rList = indexKpiMapper.getNewNum(finalDateLastYm, zrbmList);
+                    redisUtil.set(CacheKey.INDEX_ZRBM_NEW,rList,1000L * 60 * 60 * 10);
+                }
+//                List<IndexKpiCompletByDate> list = indexKpiMapper.getNewNum(finalDateLastYm, zrbmList);
+                for (IndexKpiCompletByDate i : rList){
+                    htereceivedZrbmNewMap.put(i.getDepart(),i);
+                }
+                return htereceivedZrbmNewMap;
+            });
+
+            CompletableFuture<Void> future1 = CompletableFuture.allOf(getHtereceivedZrbmMapFuture, getHtereceivedZrbmLastMapFuture,getHtereceivedXdbmHteMapFuture,getHtereceivedXdbmYskMapFuture,getHtereceivedZrbmFinalFuture,getHtereceivedZrbmNewFuture);
             future1.join();
             Map<String, IndexKpiCompletByDate> htereceivedZrbmMap = getHtereceivedZrbmMapFuture.join();
             Map<String, IndexKpiCompletByDate> htereceivedZrbmLastMap = getHtereceivedZrbmLastMapFuture.join();
             Map<String, IndexKpiCompletByDate> htereceivedXdbmHteMap = getHtereceivedXdbmHteMapFuture.join();
             Map<String, IndexKpiCompletByDate> htereceivedXdbmYskMap = getHtereceivedXdbmYskMapFuture.join();
+            Map<String, IndexKpiCompletByDate> htereceivedZrbmFinalMap = getHtereceivedZrbmFinalFuture.join();
+            Map<String, IndexKpiCompletByDate> htereceivedZrbmNewMap = getHtereceivedZrbmNewFuture.join();
+
             // 责任部门 完成度
             CompletableFuture<Void> setKpiDataZrbmList = CompletableFuture.runAsync(() -> {
                 //责任部门列表填充合同额、已收款、完成度
                 for(IndexKpiCompletByDate kpiDataZrbm:kpiDataZrbmList){
                     //根据部门找到今年的合同额和已收款
-                    IndexKpiCompletByDate htereceivedZrbm = htereceivedZrbmMap.getOrDefault(kpiDataZrbm.getDepart(), kpiDataZrbm);
-                    IndexKpiCompletByDate htereceivedZrbmLast = htereceivedZrbmLastMap.getOrDefault(kpiDataZrbm.getDepart(), kpiDataZrbm);
-                    kpiDataZrbm.setContractAmount(htereceivedZrbm.getContractAmount().subtract(htereceivedZrbmLast.getContractAmount()).setScale(2, RoundingMode.HALF_UP));//合同额
-                    kpiDataZrbm.setReceived(htereceivedZrbm.getReceived().subtract(htereceivedZrbmLast.getReceived()).setScale(2, RoundingMode.HALF_UP));//已收款
+                    if(finalIsCurrentDate){
+                        IndexKpiCompletByDate htereceivedZrbmFinal = htereceivedZrbmFinalMap.getOrDefault(kpiDataZrbm.getDepart(), kpiDataZrbm);
+                        IndexKpiCompletByDate htereceivedZrbmNew = htereceivedZrbmNewMap.getOrDefault(kpiDataZrbm.getDepart(), kpiDataZrbm);
+                        if (htereceivedZrbmFinal == null || htereceivedZrbmNew == null) {
+                            kpiDataZrbm.setContractAmount(BigDecimal.valueOf(0).setScale(2, RoundingMode.HALF_UP));
+                            kpiDataZrbm.setReceived(BigDecimal.valueOf(0).setScale(2, RoundingMode.HALF_UP));//已收款
+                        }else {
+                            kpiDataZrbm.setContractAmount(htereceivedZrbmFinal.getContractAmount().add(htereceivedZrbmNew.getContractAmount()));
+                            kpiDataZrbm.setReceived(htereceivedZrbmFinal.getReceived().add(htereceivedZrbmNew.getReceived()));//已收款
+                        }
 
+                    }else {
+                        IndexKpiCompletByDate htereceivedZrbm = htereceivedZrbmMap.getOrDefault(kpiDataZrbm.getDepart(), kpiDataZrbm);
+                        IndexKpiCompletByDate htereceivedZrbmLast = htereceivedZrbmLastMap.getOrDefault(kpiDataZrbm.getDepart(), kpiDataZrbm);
+                        if(htereceivedZrbm.getContractAmount() == null || htereceivedZrbmLast.getContractAmount() == null){
+                            kpiDataZrbm.setContractAmount(BigDecimal.valueOf(0).setScale(2, RoundingMode.HALF_UP));
+                        }else {
+                            kpiDataZrbm.setContractAmount(htereceivedZrbm.getContractAmount().subtract(htereceivedZrbmLast.getContractAmount()).setScale(2, RoundingMode.HALF_UP));//合同额
+                        }
+                        kpiDataZrbm.setReceived(htereceivedZrbm.getReceived().subtract(htereceivedZrbmLast.getReceived()).setScale(2, RoundingMode.HALF_UP));//已收款
+                    }
                     //计算完成度  合同额(是计算的某个月或某个年的合同额 增量)/ 指标
                     if(kpiDataZrbm.getDepartKpi() != null){
                         if(kpiDataZrbm.getDepartKpi().equals(BigDecimal.valueOf(0))){

+ 4 - 0
module_kzks/src/main/java/org/jeecg/modules/Index/util/CacheKey.java

@@ -29,4 +29,8 @@ public class CacheKey {
     public static final String CLF_COMPARE_RESULT_VOS= "clfCompareResultVOS";
 
     public static final String ND_KMBH_MONEY_TYPE = "kmbh_nd_money_type";
+
+    public static final String INDEX_ZRBM_FINAL = "index_zrbm_final";
+
+    public static final String INDEX_ZRBM_NEW = "index_zrbm_new";
 }

+ 8 - 0
module_kzks/src/main/java/org/jeecg/modules/projectImportList/controller/ProjectImportListController.java

@@ -26,6 +26,8 @@ import org.jeecg.modules.projectImportList.entity.ProjectImportList;
 import org.jeecg.modules.projectImportList.service.IProjectImportListService;
 import org.jeecg.modules.projectKmbh.entity.KzksProjectKmbh;
 import org.jeecg.modules.projectKmbh.service.IKzksProjectKmbhService;
+import org.jeecg.modules.wzOutboundOrderBNew.entity.WzOutboundOrderBNew;
+import org.jeecg.modules.wzOutboundOrderBNew.service.IWzOutboundOrderBNewService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
@@ -73,6 +75,10 @@ public class ProjectImportListController extends JeecgController<ProjectImportLi
     @SuppressWarnings("all")
     private IKpiImportListService kpiImportListService;
 
+    @Autowired
+    @SuppressWarnings("all")
+    private IWzOutboundOrderBNewService wzOutboundOrderBNewService;
+
 
     /**
      * 通过excel导入其他表的数据
@@ -112,6 +118,8 @@ public class ProjectImportListController extends JeecgController<ProjectImportLi
             return kpiImportListService.importExcel1(url, KpiImportList.class);
         } else if (projectImportList.getFileType().equals("9")) { //导入数据包至服务器
             return result.success("");
+        } else if (projectImportList.getFileType().equals("10")){
+            return wzOutboundOrderBNewService.importExcel1(url, WzOutboundOrderBNew.class);
         } else {
             result.setCode(500);
             result.setMessage("请选择正确的导入类型!");

+ 177 - 0
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrderBNew/controller/WzOutboundOrderBNewController.java

@@ -0,0 +1,177 @@
+package org.jeecg.modules.wzOutboundOrderBNew.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.wzOutboundOrderBNew.entity.WzOutboundOrderBNew;
+import org.jeecg.modules.wzOutboundOrderBNew.service.IWzOutboundOrderBNewService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: wz_outbound_order_b_new
+ * @Author: jeecg-boot
+ * @Date:   2024-03-25
+ * @Version: V1.0
+ */
+@Api(tags="wz_outbound_order_b_new")
+@RestController
+@RequestMapping("/wzOutboundOrderBNew/wzOutboundOrderBNew")
+@Slf4j
+public class WzOutboundOrderBNewController extends JeecgController<WzOutboundOrderBNew, IWzOutboundOrderBNewService> {
+	@Autowired
+	private IWzOutboundOrderBNewService wzOutboundOrderBNewService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param wzOutboundOrderBNew
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "wz_outbound_order_b_new-分页列表查询")
+	@ApiOperation(value="wz_outbound_order_b_new-分页列表查询", notes="wz_outbound_order_b_new-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<WzOutboundOrderBNew>> queryPageList(WzOutboundOrderBNew wzOutboundOrderBNew,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<WzOutboundOrderBNew> queryWrapper = QueryGenerator.initQueryWrapper(wzOutboundOrderBNew, req.getParameterMap());
+		Page<WzOutboundOrderBNew> page = new Page<WzOutboundOrderBNew>(pageNo, pageSize);
+		IPage<WzOutboundOrderBNew> pageList = wzOutboundOrderBNewService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param wzOutboundOrderBNew
+	 * @return
+	 */
+	@AutoLog(value = "wz_outbound_order_b_new-添加")
+	@ApiOperation(value="wz_outbound_order_b_new-添加", notes="wz_outbound_order_b_new-添加")
+	//@RequiresPermissions("org.jeecg.modules:wz_outbound_order_b_new:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody WzOutboundOrderBNew wzOutboundOrderBNew) {
+		wzOutboundOrderBNewService.save(wzOutboundOrderBNew);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param wzOutboundOrderBNew
+	 * @return
+	 */
+	@AutoLog(value = "wz_outbound_order_b_new-编辑")
+	@ApiOperation(value="wz_outbound_order_b_new-编辑", notes="wz_outbound_order_b_new-编辑")
+	//@RequiresPermissions("org.jeecg.modules:wz_outbound_order_b_new:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody WzOutboundOrderBNew wzOutboundOrderBNew) {
+		wzOutboundOrderBNewService.updateById(wzOutboundOrderBNew);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "wz_outbound_order_b_new-通过id删除")
+	@ApiOperation(value="wz_outbound_order_b_new-通过id删除", notes="wz_outbound_order_b_new-通过id删除")
+	//@RequiresPermissions("org.jeecg.modules:wz_outbound_order_b_new:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		wzOutboundOrderBNewService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "wz_outbound_order_b_new-批量删除")
+	@ApiOperation(value="wz_outbound_order_b_new-批量删除", notes="wz_outbound_order_b_new-批量删除")
+	//@RequiresPermissions("org.jeecg.modules:wz_outbound_order_b_new:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.wzOutboundOrderBNewService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "wz_outbound_order_b_new-通过id查询")
+	@ApiOperation(value="wz_outbound_order_b_new-通过id查询", notes="wz_outbound_order_b_new-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<WzOutboundOrderBNew> queryById(@RequestParam(name="id",required=true) String id) {
+		WzOutboundOrderBNew wzOutboundOrderBNew = wzOutboundOrderBNewService.getById(id);
+		if(wzOutboundOrderBNew==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(wzOutboundOrderBNew);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param wzOutboundOrderBNew
+    */
+    //@RequiresPermissions("org.jeecg.modules:wz_outbound_order_b_new:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, WzOutboundOrderBNew wzOutboundOrderBNew) {
+        return super.exportXls(request, wzOutboundOrderBNew, WzOutboundOrderBNew.class, "wz_outbound_order_b_new");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("wz_outbound_order_b_new:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, WzOutboundOrderBNew.class);
+    }
+
+}

+ 295 - 0
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrderBNew/entity/WzOutboundOrderBNew.java

@@ -0,0 +1,295 @@
+package org.jeecg.modules.wzOutboundOrderBNew.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: wz_outbound_order_b_new
+ * @Author: jeecg-boot
+ * @Date:   2024-03-25
+ * @Version: V1.0
+ */
+@Data
+@TableName("wz_outbound_order_b_new")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="wz_outbound_order_b_new对象", description="wz_outbound_order_b_new")
+public class WzOutboundOrderBNew implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**id*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "id")
+    private java.lang.String id;
+	/**来源(日期)*/
+	@Excel(name = "来源", width = 15)
+    @ApiModelProperty(value = "来源(日期)")
+    private java.lang.String ly;
+	/**库存组织*/
+	@Excel(name = "库存组织", width = 15)
+    @ApiModelProperty(value = "库存组织")
+    private java.lang.String kczz;
+	/**仓库*/
+	@Excel(name = "仓库", width = 15)
+    @ApiModelProperty(value = "仓库")
+    private java.lang.String ck;
+	/**制单人*/
+	@Excel(name = "制单人", width = 15)
+    @ApiModelProperty(value = "制单人")
+    private java.lang.String zdr;
+	/**制单日期*/
+	@Excel(name = "制单日期", width = 15)
+    @ApiModelProperty(value = "制单日期")
+    private java.lang.String zdrq;
+	/**出库单号*/
+	@Excel(name = "出库单号", width = 15)
+    @ApiModelProperty(value = "出库单号")
+    private java.lang.String ckdh;
+	/**行号*/
+	@Excel(name = "行号", width = 15)
+    @ApiModelProperty(value = "行号")
+    private java.lang.String hh;
+	/**出库类型*/
+	@Excel(name = "出库类型", width = 15)
+    @ApiModelProperty(value = "出库类型")
+    private java.lang.String cklx;
+	/**原图纸编码*/
+	@Excel(name = "原图纸编码", width = 15)
+    @ApiModelProperty(value = "原图纸编码")
+    private java.lang.String ytzbm;
+	/**原图纸规格*/
+	@Excel(name = "原图纸规格", width = 15)
+    @ApiModelProperty(value = "原图纸规格")
+    private java.lang.String ytzgg;
+	/**物料分类*/
+	@Excel(name = "物料分类", width = 15)
+    @ApiModelProperty(value = "物料分类")
+    private java.lang.String wlfl;
+	/**物料编码*/
+	@Excel(name = "物料编码", width = 15)
+    @ApiModelProperty(value = "物料编码")
+    private java.lang.String wlbm;
+	/**是否积压物资*/
+	@Excel(name = "是否积压物资", width = 15)
+    @ApiModelProperty(value = "是否积压物资")
+    private java.lang.String sfjywz;
+	/**国产/进口*/
+	@Excel(name = "国产/进口", width = 15)
+    @ApiModelProperty(value = "国产/进口")
+    private java.lang.String gcjk;
+	/**物资名称*/
+	@Excel(name = "物资名称", width = 15)
+    @ApiModelProperty(value = "物资名称")
+    private java.lang.String wzmc;
+	/**规格型号*/
+	@Excel(name = "规格型号", width = 15)
+    @ApiModelProperty(value = "规格型号")
+    private java.lang.String ggxh;
+	/**外观标识*/
+	@Excel(name = "外观标识", width = 15)
+    @ApiModelProperty(value = "外观标识")
+    private java.lang.String wgbs;
+	/**供应商批次号*/
+	@Excel(name = "供应商批次号", width = 15)
+    @ApiModelProperty(value = "供应商批次号")
+    private java.lang.String gyspch;
+	/**质量等级*/
+	@Excel(name = "质量等级", width = 15)
+    @ApiModelProperty(value = "质量等级")
+    private java.lang.String zldj;
+	/**封装形式*/
+	@Excel(name = "封装形式", width = 15)
+    @ApiModelProperty(value = "封装形式")
+    private java.lang.String fzxs;
+	/**生产厂商*/
+	@Excel(name = "生产厂商", width = 15)
+    @ApiModelProperty(value = "生产厂商")
+    private java.lang.String sccs;
+	/**应发数量*/
+	@Excel(name = "应发数量", width = 15)
+    @ApiModelProperty(value = "应发数量")
+    private java.math.BigDecimal yfsl;
+	/**实发数量*/
+	@Excel(name = "实发数量", width = 15)
+    @ApiModelProperty(value = "实发数量")
+    private java.math.BigDecimal sfsl;
+	/**质保有效期*/
+	@Excel(name = "质保有效期", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "质保有效期")
+    private java.util.Date zbyxq;
+	/**质保单位*/
+	@Excel(name = "质保单位", width = 15)
+    @ApiModelProperty(value = "质保单位")
+    private java.lang.String zbdw;
+	/**质保依据*/
+	@Excel(name = "质保依据", width = 15)
+    @ApiModelProperty(value = "质保依据")
+    private java.lang.String zbyj;
+	/**配套指令号*/
+	@Excel(name = "配套指令号", width = 15)
+    @ApiModelProperty(value = "配套指令号")
+    private java.lang.String ptzlh;
+	/**投产任务号*/
+	@Excel(name = "投产任务号", width = 15)
+    @ApiModelProperty(value = "投产任务号")
+    private java.lang.String tcrwh;
+	/**研制阶段*/
+	@Excel(name = "研制阶段", width = 15)
+    @ApiModelProperty(value = "研制阶段")
+    private java.lang.String yzjd;
+	/**设备名称*/
+	@Excel(name = "设备名称", width = 15)
+    @ApiModelProperty(value = "设备名称")
+    private java.lang.String sbmc;
+	/**单板号*/
+	@Excel(name = "单板号", width = 15)
+    @ApiModelProperty(value = "单板号")
+    private java.lang.String dbh;
+	/**合格证号*/
+	@Excel(name = "合格证号", width = 15)
+    @ApiModelProperty(value = "合格证号")
+    private java.lang.String hgzh;
+	/**合格证是否已上传*/
+	@Excel(name = "合格证是否已上传", width = 15)
+    @ApiModelProperty(value = "合格证是否已上传")
+    private java.lang.String hgzysc;
+	/**DPA号*/
+	@Excel(name = "DPA号", width = 15)
+    @ApiModelProperty(value = "DPA号")
+    private java.lang.String dpah;
+	/**领用单位*/
+	@Excel(name = "领用单位", width = 15)
+    @ApiModelProperty(value = "领用单位")
+    private java.lang.String lydw;
+	/**领用人*/
+	@Excel(name = "领用人", width = 15)
+    @ApiModelProperty(value = "领用人")
+    private java.lang.String lyr;
+	/**仓库名称*/
+	@Excel(name = "仓库名称", width = 15)
+    @ApiModelProperty(value = "仓库名称")
+    private java.lang.String ckmc;
+	/**单据状态*/
+	@Excel(name = "单据状态", width = 15)
+    @ApiModelProperty(value = "单据状态")
+    private java.lang.String djztone;
+	/**单位*/
+	@Excel(name = "单位", width = 15)
+    @ApiModelProperty(value = "单位")
+    private java.lang.String dw;
+	/**内转移价*/
+	@Excel(name = "内转移价", width = 15)
+    @ApiModelProperty(value = "内转移价")
+    private java.lang.String nzyj;
+	/**单价*/
+	@Excel(name = "单价", width = 15)
+    @ApiModelProperty(value = "单价")
+    private java.math.BigDecimal nbdj;
+	/**采购单价*/
+	@Excel(name = "采购单价", width = 15)
+    @ApiModelProperty(value = "采购单价")
+    private java.math.BigDecimal cgdj;
+	/**金额*/
+	@Excel(name = "金额", width = 15)
+    @ApiModelProperty(value = "金额")
+    private java.math.BigDecimal je;
+	/**储位号*/
+	@Excel(name = "储位号", width = 15)
+    @ApiModelProperty(value = "储位号")
+    private java.lang.String cwh;
+	/**当前保管员*/
+	@Excel(name = "当前保管员", width = 15)
+    @ApiModelProperty(value = "当前保管员")
+    private java.lang.String dqbgy;
+	/**出库状态*/
+	@Excel(name = "出库状态", width = 15)
+    @ApiModelProperty(value = "出库状态")
+    private java.lang.String ckzt;
+	/**单据状态*/
+	@Excel(name = "单据状态", width = 15)
+    @ApiModelProperty(value = "单据状态")
+    private java.lang.String djzttwo;
+	/**配套单号*/
+	@Excel(name = "配套单号", width = 15)
+    @ApiModelProperty(value = "配套单号")
+    private java.lang.String ptdh;
+	/**备料计划单号*/
+	@Excel(name = "备料计划单号", width = 15)
+    @ApiModelProperty(value = "备料计划单号")
+    private java.lang.String bljhdh;
+	/**批次号*/
+	@Excel(name = "批次号", width = 15)
+    @ApiModelProperty(value = "批次号")
+    private java.lang.String pch;
+	/**首次入库时间*/
+	@Excel(name = "首次入库时间", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "首次入库时间")
+    private java.util.Date scrksj;
+	/**任务号*/
+	@Excel(name = "任务号", width = 15)
+    @ApiModelProperty(value = "任务号")
+    private java.lang.String rwh;
+	/**型号分类*/
+	@Excel(name = "型号分类", width = 15)
+    @ApiModelProperty(value = "型号分类")
+    private java.lang.String xhfl;
+	/**军品管理员*/
+	@Excel(name = "军品管理员", width = 15)
+    @ApiModelProperty(value = "军品管理员")
+    private java.lang.String jpgly;
+	/**民品管理员*/
+	@Excel(name = "民品管理员", width = 15)
+    @ApiModelProperty(value = "民品管理员")
+    private java.lang.String mpgly;
+	/**箱号*/
+	@Excel(name = "箱号", width = 15)
+    @ApiModelProperty(value = "箱号")
+    private java.lang.String xh;
+	/**智能仓储标识*/
+	@Excel(name = "智能仓储标识", width = 15)
+    @ApiModelProperty(value = "智能仓储标识")
+    private java.lang.String znccbs;
+	/**打印次数*/
+	@Excel(name = "打印次数", width = 15)
+    @ApiModelProperty(value = "打印次数")
+    private java.lang.String dycs;
+	/**A*/
+	@Excel(name = "A", width = 15)
+    @ApiModelProperty(value = "A")
+    private java.lang.String a;
+	/**优先级*/
+	@Excel(name = "优先级", width = 15)
+    @ApiModelProperty(value = "优先级")
+    private java.lang.String yxj;
+	/**年*/
+	@Excel(name = "年", width = 15)
+    @ApiModelProperty(value = "年")
+    private java.lang.Integer year;
+	/**月*/
+	@Excel(name = "月", width = 15)
+    @ApiModelProperty(value = "月")
+    private java.lang.Integer month;
+	/**年月*/
+	@Excel(name = "年月", width = 15)
+    @ApiModelProperty(value = "年月")
+    private java.lang.String yearmonth;
+}

+ 27 - 0
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrderBNew/mapper/WzOutboundOrderBNewMapper.java

@@ -0,0 +1,27 @@
+package org.jeecg.modules.wzOutboundOrderBNew.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Update;
+import org.jeecg.modules.wzOutboundOrderBNew.entity.WzOutboundOrderBNew;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: wz_outbound_order_b_new
+ * @Author: jeecg-boot
+ * @Date:   2024-03-25
+ * @Version: V1.0
+ */
+public interface WzOutboundOrderBNewMapper extends BaseMapper<WzOutboundOrderBNew> {
+
+
+    /** 清空表中数据 */
+    @Update("truncate table wz_outbound_order_b_new")
+    public void truncateTable();
+
+    /** 删除表中今年的数据 */
+    public int deleteByDate(@Param("currentyear") Integer currentyear);
+
+
+}

+ 8 - 0
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrderBNew/mapper/xml/WzOutboundOrderBNewMapper.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.wzOutboundOrderBNew.mapper.WzOutboundOrderBNewMapper">
+
+    <delete id="deleteByDate">
+        delete from wz_outbound_order_b_new where year = #{currentyear}
+    </delete>
+</mapper>

+ 17 - 0
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrderBNew/service/IWzOutboundOrderBNewService.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.wzOutboundOrderBNew.service;
+
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.wzOutboundOrderBNew.entity.WzOutboundOrderBNew;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: wz_outbound_order_b_new
+ * @Author: jeecg-boot
+ * @Date:   2024-03-25
+ * @Version: V1.0
+ */
+public interface IWzOutboundOrderBNewService extends IService<WzOutboundOrderBNew> {
+
+    Result<?> importExcel1(String strUrl, Class<WzOutboundOrderBNew> clazz);
+
+}

+ 82 - 0
module_kzks/src/main/java/org/jeecg/modules/wzOutboundOrderBNew/service/impl/WzOutboundOrderBNewServiceImpl.java

@@ -0,0 +1,82 @@
+package org.jeecg.modules.wzOutboundOrderBNew.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.util.DateUtils;
+import org.jeecg.modules.projectKmbh.entity.KzksProjectKmbh;
+import org.jeecg.modules.wzOutboundOrderBNew.entity.WzOutboundOrderBNew;
+import org.jeecg.modules.wzOutboundOrderBNew.mapper.WzOutboundOrderBNewMapper;
+import org.jeecg.modules.wzOutboundOrderBNew.service.IWzOutboundOrderBNewService;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Description: wz_outbound_order_b_new
+ * @Author: jeecg-boot
+ * @Date:   2024-03-25
+ * @Version: V1.0
+ */
+@Service
+@Slf4j
+public class WzOutboundOrderBNewServiceImpl extends ServiceImpl<WzOutboundOrderBNewMapper, WzOutboundOrderBNew> implements IWzOutboundOrderBNewService {
+
+    @Autowired
+    @SuppressWarnings("all")
+    private WzOutboundOrderBNewMapper orderBNewMapper;
+
+    @Override
+    public Result<?> importExcel1(String strUrl, Class<WzOutboundOrderBNew> clazz) {
+        InputStream inputStream = null;
+        try {
+            inputStream = new FileInputStream(strUrl);
+        } catch (FileNotFoundException e) {
+            e.printStackTrace();
+        }
+
+        // 获取上传文件对象
+        ImportParams params = new ImportParams();
+        params.setTitleRows(0);
+        params.setHeadRows(1);
+        params.setNeedSave(true);
+        try {
+            List<WzOutboundOrderBNew> list = ExcelImportUtil.importExcel(inputStream, clazz, params);
+            int year = DateUtils.getYear();
+            orderBNewMapper.deleteByDate(year);
+            //update-begin-author:taoyan date:20190528 for:批量插入数据
+            long start = System.currentTimeMillis();
+            this.saveBatch(list);
+            log.info("消耗时间" + (System.currentTimeMillis() - start) + "毫秒");
+            //update-end-author:taoyan date:20190528 for:批量插入数据
+            return Result.ok("文件导入成功!数据行数:" + list.size());
+        } catch (Exception e) {
+            //update-begin-author:taoyan date:20211124 for: 导入数据重复增加提示
+            String msg = e.getMessage();
+            log.error(msg, e);
+            if (msg != null && msg.indexOf("Duplicate entry") >= 0) {
+                return Result.error("文件导入失败:有重复数据!");
+            } else {
+                return Result.error("文件导入失败:" + e.getMessage());
+            }
+            //update-end-author:taoyan date:20211124 for: 导入数据重复增加提示
+        } finally {
+            try {
+                inputStream.close();
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+}