Kaynağa Gözat

产品同步

ezhizao_zx 1 yıl önce
ebeveyn
işleme
10213e0a29

+ 253 - 0
src/main/java/cn/ezhizao/project/business/controller/Inc10100Controller.java

@@ -0,0 +1,253 @@
+package cn.ezhizao.project.business.controller;
+
+import cn.ezhizao.framework.web.controller.BaseController;
+import cn.ezhizao.framework.web.domain.AjaxResult;
+import cn.ezhizao.project.business.domain.*;
+import cn.ezhizao.project.business.service.IBizProductService;
+import cn.ezhizao.project.business.service.IBizPullP2TimeService;
+import cn.ezhizao.project.business.service.IBizShaftCategoryService;
+import cn.ezhizao.project.business.service.IInc10100Service;
+import cn.ezhizao.project.system.domain.SysDictData;
+import cn.ezhizao.project.system.domain.SysUser;
+import cn.ezhizao.project.system.service.ISysDeptService;
+import cn.ezhizao.project.system.service.ISysDictDataService;
+import cn.ezhizao.project.system.service.ISysUserService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * mrp10201Controller
+ *
+ * @author ezhizao_zx
+ */
+@RestController
+@RequestMapping("/business/inc10100")
+public class Inc10100Controller extends BaseController {
+
+
+    @Resource
+    private IBizPullP2TimeService pullP2TimeService;
+    @Resource
+    private IInc10100Service IInc10100Service;
+    @Resource
+    private IBizProductService productService;
+
+    @Resource
+    private ISysUserService sysUserService;
+    @Resource
+    private ISysDeptService sysDeptService;
+    @Resource
+    private ISysDictDataService sysDictDataService;
+
+    @Resource
+    private IBizShaftCategoryService bizShaftCategoryService;
+
+    /**
+     * 获取inc10100详细信息
+     * 获取 inc10100 信息传到 biz_product
+     */
+    @PreAuthorize("@ss.hasPermi('business:product:sync')")
+    @GetMapping(value = "/getP2Product")
+    public AjaxResult getP2Product() {
+        // 先从新系统中的 biz_pull_p2_time 中获取最新数据
+        BizPullP2Time pullDetail = new BizPullP2Time();
+        pullDetail.setType("product");
+        List<BizPullP2Time> pullDetails = pullP2TimeService.getList(pullDetail);
+        /*
+         * 如果 pullDetails 不为空,则获取最后一条数据,做为查询P2的生产计划明细的条件。
+         * 这里有个细节,每次从P2中获取生产计划明细,不能都从头开始,否则随着数据量增加,将会重复拉取大量的数据,性能很差
+         * 拉取数据后,存入新系统中,每次拉取前,将新系统中 biz_pull_p2_time 的最后一条数据记录的时间,做为条件传递过去
+         * P2中,获取领料时间大于上一次拉取时间的新数据,再存入新系统中。
+         */
+        BizPullP2Time lastPullDetail = null;
+        if (pullDetails.size() > 0) {
+            int lastIndex = pullDetails.size() - 1;
+            lastPullDetail = pullDetails.get(lastIndex);
+        }
+
+        QueryWrapper<Inc10100> queryWrapper = new QueryWrapper<>();
+        if (lastPullDetail != null) {
+            Date newCondition = lastPullDetail.getPullTime();
+            /*
+             * 这里应该根据新系统中记录的最大的拉取日期
+             * modate:P2中的修改日期,为了避免重复拉取,需要做条件判断。modate必须大于上一次拉取时间
+             */
+            queryWrapper.apply("modate IS NOT NULL  AND modate > {0}", newCondition);
+        }
+        List<Inc10100> inc10100List = IInc10100Service.getList(queryWrapper);
+        List<BizProduct> products = productService.query().list();
+        List<BizProduct> newProducts = new ArrayList<>();
+        List<BizProduct> changeProducts = new ArrayList<>();
+        List<SysUser> userList = sysUserService.getList();
+        SysDictData conditions = new SysDictData();
+        conditions.setDictType("product_status_code");
+        List<SysDictData> dictList = sysDictDataService.selectDictDataList(conditions);
+        List<BizShaftCategory> categories = bizShaftCategoryService.query().list();
+        inc10100List.forEach(l -> {
+            if (products.stream().anyMatch(v -> v.getProductCode().equals(l.getPart().trim()) && v.getPreStock().equals(l.getPrloc().trim()))) {
+                // 已插入产品
+                BizProduct old = products.stream().filter(v -> v.getProductCode().equals(l.getPart().trim()) && v.getPreStock().equals(l.getPrloc().trim())).findFirst().orElse(null);
+                if (old != null) {
+                    old.setType(l.getType());
+                    old.setShaftBroadCategoryCode(l.getDtype());
+                    old.setShaftCategoryCode(l.getZtype());
+                    if (old.getShaftCategoryCode() != null) {
+                        BizShaftCategory bizShaftCategory = categories.stream().filter(v -> v.getSubCategoryCode().equals(old.getShaftCategoryCode())).findFirst().orElse(null);
+                        old.setShaftCategoryId(bizShaftCategory != null ? bizShaftCategory.getId() : null);
+                    }
+                    if (old.getShaftBroadCategoryCode() != null) {
+
+                    }
+                    old.setSpecification(l.getSpec());
+                    old.setDrawingNumber(l.getDraw());
+                    old.setCompanyAlias(l.getKhjc());
+                    old.setCompanyCode(l.getCust());
+                    old.setDescription(l.getDescr());
+                    old.setProductionTenantId(l.getSfacno() != null ? Long.parseLong(l.getSfacno()) : null);
+                    old.setDiameter(l.getDzj());
+                    old.setLenght(l.getLenght());
+                    old.setThickness(BigDecimal.valueOf(l.getAbbr()));
+                    old.setDensity(l.getDensity());
+                    old.setSalesmanCode(l.getXsyno());
+                    if (old.getSalesmanCode() != null) {
+                        SysUser user = userList.stream().filter(v -> v.getUserName().equals(old.getSalesmanCode())).findFirst().orElse(null);
+                        old.setSalesmanId(user != null ? user.getUserId() : null);
+                    }
+                    old.setStockKeeperCode(l.getBgyno());
+                    if (old.getStockKeeperCode() != null) {
+                        SysUser bgy = userList.stream().filter(v -> v.getUserName().equals(old.getStockKeeperCode())).findFirst().orElse(null);
+                        old.setStockKeeperId(bgy != null ? bgy.getUserId() : null);
+                    }
+                    old.setDispatcherCode(l.getDdyno());
+                    if (old.getDispatcherCode() != null) {
+                        SysUser ddy = userList.stream().filter(v -> v.getUserName().equals(old.getDispatcherCode())).findFirst().orElse(null);
+                        old.setDispatcherId(ddy != null ? ddy.getUserId() : null);
+                    }
+                    old.setMaterialCode(l.getPhcode());
+                    if (old.getMaterialCode() != null) {
+                        // 目前没有材料表
+                    }
+                    old.setProductStatusCode(l.getStatus());
+                    if (old.getProductStatusCode() != null) {
+                        SysDictData dictData = dictList.stream().filter(v -> v.getDictValue().equals(old.getProductStatusCode())).findFirst().orElse(null);
+                        old.setProductStatusId(dictData != null ? dictData.getDictCode() : null);
+                    }
+                    old.setTechnicianCode(l.getJsyno());
+                    if (old.getTechnicianCode() != null) {
+                        SysUser jsy = userList.stream().filter(v -> v.getUserName().equals(old.getTechnicianCode())).findFirst().orElse(null);
+                        old.setTechnicianId(jsy != null ? jsy.getUserId() : null);
+                    }
+                    old.setRemark(l.getRemark());
+                    changeProducts.add(old);
+                }
+            } else {
+                // 新产品
+                BizProduct newProduct = new BizProduct();
+                newProduct.setProductCode(l.getPart());
+                newProduct.setPreStock(l.getPrloc());
+                newProduct.setType(l.getType());
+                newProduct.setShaftBroadCategoryCode(l.getDtype());
+                newProduct.setShaftCategoryCode(l.getZtype());
+                if (newProduct.getShaftCategoryCode() != null) {
+                    BizShaftCategory bizShaftCategory = categories.stream().filter(v -> v.getSubCategoryCode().equals(newProduct.getShaftCategoryCode())).findFirst().orElse(null);
+                    newProduct.setShaftCategoryId(bizShaftCategory != null ? bizShaftCategory.getId() : null);
+                }
+                if (newProduct.getShaftBroadCategoryCode() != null) {
+
+                }
+                newProduct.setSpecification(l.getSpec());
+                newProduct.setDrawingNumber(l.getDraw());
+                newProduct.setCompanyAlias(l.getKhjc());
+                newProduct.setCompanyCode(l.getCust());
+                newProduct.setDescription(l.getDescr());
+                newProduct.setProductionTenantId(l.getSfacno() != null ? Long.parseLong(l.getSfacno()) : null);
+                newProduct.setDiameter(l.getDzj());
+                newProduct.setLenght(l.getLenght());
+                newProduct.setThickness(BigDecimal.valueOf(l.getAbbr()));
+                newProduct.setDensity(l.getDensity());
+                newProduct.setSalesmanCode(l.getXsyno());
+                if (newProduct.getSalesmanCode() != null) {
+                    SysUser user = userList.stream().filter(v -> v.getUserName().equals(newProduct.getSalesmanCode())).findFirst().orElse(null);
+                    newProduct.setSalesmanId(user != null ? user.getUserId() : null);
+                }
+                newProduct.setStockKeeperCode(l.getBgyno());
+                if (newProduct.getStockKeeperCode() != null) {
+                    SysUser user = userList.stream().filter(v -> v.getUserName().equals(newProduct.getStockKeeperCode())).findFirst().orElse(null);
+                    newProduct.setStockKeeperId(user != null ? user.getUserId() : null);
+                }
+                newProduct.setDispatcherCode(l.getDdyno());
+                if (newProduct.getDispatcherCode() != null) {
+                    SysUser user = userList.stream().filter(v -> v.getUserName().equals(newProduct.getDispatcherCode())).findFirst().orElse(null);
+                    newProduct.setDispatcherId(user != null ? user.getUserId() : null);
+                }
+                newProduct.setMaterialCode(l.getPhcode());
+                if (newProduct.getMaterialCode() != null) {
+                    // 目前没有材料表
+                }
+                newProduct.setProductStatusCode(l.getStatus());
+                if (newProduct.getProductStatusCode() != null) {
+                    SysDictData dictData = dictList.stream().filter(v -> v.getDictValue().equals(newProduct.getProductStatusCode())).findFirst().orElse(null);
+                    newProduct.setProductStatusId(dictData != null ? dictData.getDictCode() : null);
+                }
+                newProduct.setTechnicianCode(l.getJsyno());
+                if (newProduct.getTechnicianCode() != null) {
+                    SysUser jsy = userList.stream().filter(v -> v.getUserName().equals(newProduct.getTechnicianCode())).findFirst().orElse(null);
+                    newProduct.setTechnicianId(jsy != null ? jsy.getUserId() : null);
+                }
+                newProduct.setRemark(l.getRemark());
+                newProducts.add(newProduct);
+            }
+        });
+        if ((newProducts.isEmpty() || productService.saveBatch(newProducts)) && (changeProducts.isEmpty() || productService.updateBatchById(changeProducts))) {
+            BizPullP2Time bizPullP2Time = new BizPullP2Time();
+            // 将当前时间赋值给 pullTime 属性
+            bizPullP2Time.setPullTime(new Date());
+            bizPullP2Time.setType("product");
+            // 保存数据
+            pullP2TimeService.saveOrUpdate(bizPullP2Time);
+            return toAjax(true);
+        }
+        return toAjax(false);
+    }
+
+    /**
+     * 根据字典类型和字典值,获取字典数据
+     *
+     * @param type  字典类型
+     * @param value 字典值
+     * @return 字典数据
+     */
+    private SysDictData getDictData(String type, String value) {
+        SysDictData sysDictData = new SysDictData();
+        sysDictData.setDictType(type);
+        sysDictData.setDictValue(value);
+
+        return sysDictDataService.getDictData(sysDictData);
+    }
+
+    /**
+     * @param userName 用戶名
+     * @return 用户信息
+     */
+    private SysUser getUserByCode(String userName) {
+        return sysUserService.getUserByCode(userName.trim());
+    }
+
+    /**
+     * 根据轴类型编码,获取新系统中的轴类型id【需要进一步实现】
+     * @param code 轴类型编码
+     * @return 轴类型
+     */
+    public BizShaftCategory getShaftCode(String code) {
+        return bizShaftCategoryService.query().eq("sub_category_code", code).one();
+    }
+}

+ 12 - 1
src/main/java/cn/ezhizao/project/business/domain/BizProduct.java

@@ -169,5 +169,16 @@ public class BizProduct extends BaseEntity
     @ApiModelProperty(value = "创建者编码")
     private String creatorCode;
 
-
+    @ApiModelProperty("密度")
+    private BigDecimal density;
+
+    @ApiModelProperty("材料编号")
+    private String materialCode;
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注")
+    @TableField(exist = true)
+    private String remark;
 }

+ 253 - 0
src/main/java/cn/ezhizao/project/business/domain/Inc10100.java

@@ -0,0 +1,253 @@
+package cn.ezhizao.project.business.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 产品对象 inc10100
+ *
+ * @author ezhizao_zx
+ * @date 2023-11-04
+ */
+@Data
+@TableName(value = "inc10100")
+public class Inc10100 {
+    /** 料号 */
+    @ApiModelProperty(value = "${comment}")
+    private String part;
+    /** 预入仓库 */
+    @ApiModelProperty(value = "${comment}")
+    private String prloc;
+    /** 类别9:成品8:半成品 */
+    @ApiModelProperty(value = "${comment}")
+    private String type;
+    /** 大类编码 */
+    @ApiModelProperty(value = "${comment}")
+    private String bclass;
+    /** 小类编码 */
+    @ApiModelProperty(value = "${comment}")
+    private String sclass;
+    /** 轴类型 大类 */
+    @ApiModelProperty(value = "${comment}")
+    private String dtype;
+    /** 轴类型 基本类 */
+    @ApiModelProperty(value = "${comment}")
+    private String ztype;
+    /** 规格 */
+    @ApiModelProperty(value = "${comment}")
+    private String spec;
+    /** 图号 */
+    @ApiModelProperty(value = "${comment}")
+    private String draw;
+    /** 客户简称 */
+    @ApiModelProperty(value = "${comment}")
+    private String khjc;
+    /** 客户简称_图号_规格 */
+    @ApiModelProperty(value = "${comment}")
+    private String descr;
+    /** 单位 */
+    @ApiModelProperty(value = "${comment}")
+    private String uom;
+    /** 计料形式 */
+    @ApiModelProperty(value = "${comment}")
+    private String isstype;
+    /** 1:柱体2:圆管3:圆片4:组件9:其它 */
+    @ApiModelProperty(value = "${comment}")
+    private String xztype;
+    /** 成品坯重g/个毛重 */
+    @ApiModelProperty(value = "${comment}")
+    private BigDecimal kos;
+    /** 成品单重净重g/个 */
+    @ApiModelProperty(value = "${comment}")
+    private BigDecimal kgs;
+    /** 生产厂家与最终客户的关系 */
+    @ApiModelProperty(value = "${comment}")
+    private String rkbz;
+    /** 隶属厂别 */
+    @ApiModelProperty(value = "${comment}")
+    private String facno;
+    /** 生产单位 */
+    @ApiModelProperty(value = "${comment}")
+    private String sfacno;
+    /** 密度 */
+    @ApiModelProperty(value = "${comment}")
+    private BigDecimal density;
+    /** 直径 */
+    @ApiModelProperty(value = "${comment}")
+    private BigDecimal dzj;
+    /** 成品长度 */
+    @ApiModelProperty(value = "${comment}")
+    private BigDecimal lenght;
+    /** 厚度 */
+    @ApiModelProperty(value = "${comment}")
+    private Integer abbr;
+    /** 直径 */
+    @ApiModelProperty(value = "${comment}")
+    private String dzjs;
+    /** 成品长度 */
+    @ApiModelProperty(value = "${comment}")
+    private String lenghts;
+    /** 厚度 */
+    @ApiModelProperty(value = "${comment}")
+    private String abbrs;
+    /** 客户物料号 */
+    @ApiModelProperty(value = "${comment}")
+    private String khpart;
+    /** 客户订单号 */
+    @ApiModelProperty(value = "${comment}")
+    private String khorder;
+    /** 客户商品名称 */
+    @ApiModelProperty(value = "${comment}")
+    private String spname;
+    /** 客户代号 */
+    @ApiModelProperty(value = "${comment}")
+    private String cust;
+    /** 销售业务员 */
+    @ApiModelProperty(value = "${comment}")
+    private String xsyno;
+    /** 保管员 */
+    @ApiModelProperty(value = "${comment}")
+    private String bgyno;
+    /** 调度员 */
+    @ApiModelProperty(value = "${comment}")
+    private String ddyno;
+    /** 华普商品编码 */
+    @ApiModelProperty(value = "${comment}")
+    private String hpart;
+    /** 周转箱产品净重 */
+    @ApiModelProperty(value = "${comment}")
+    private BigDecimal zykos;
+    /** 建立者 */
+    @ApiModelProperty(value = "${comment}")
+    private String createuser;
+    /** 建立日期 */
+    @ApiModelProperty(value = "${comment}")
+    private Date createdate;
+    /** 打印合格证厂别 1德迈仕 2金华德 */
+    @ApiModelProperty(value = "${comment}")
+    private String facnoh;
+    /** 单盒支数 */
+    @ApiModelProperty(value = "${comment}")
+    private Integer dxzs;
+    /** 订单号 */
+    @ApiModelProperty(value = "${comment}")
+    private String orderno;
+    /** 包装合数 */
+    @ApiModelProperty(value = "${comment}")
+    private Integer bzhs;
+    /**  */
+    @ApiModelProperty(value = "${comment}")
+    private Integer weigs;
+    /** 商品简码或客户批号 */
+    @ApiModelProperty(value = "${comment}")
+    private String spcode;
+    /** 材料牌号 */
+    @ApiModelProperty(value = "${comment}")
+    private String phcode;
+    /** 材料牌号 */
+    @ApiModelProperty(value = "${comment}")
+    private String phname;
+    /** 销售平均单价 */
+    @ApiModelProperty(value = "${comment}")
+    private BigDecimal unprc;
+    /** 有半成品YN是否在金华德生产后购入 */
+    @ApiModelProperty(value = "${comment}")
+    private String zjbz;
+    /** Z:重点类N:非重点类 */
+    @ApiModelProperty(value = "${comment}")
+    private String qcbz;
+    /** 量产时间 */
+    @ApiModelProperty(value = "${comment}")
+    private String lcsj;
+    /** 前期预示量 */
+    @ApiModelProperty(value = "${comment}")
+    private String qysl;
+    /** 年使用量 */
+    @ApiModelProperty(value = "${comment}")
+    private String nsyl;
+    /** 年使用量 */
+    @ApiModelProperty(value = "${comment}")
+    private String nsyl1;
+    /** 年使用量 */
+    @ApiModelProperty(value = "${comment}")
+    private String nsyl2;
+    /** 通知单日期 */
+    @ApiModelProperty(value = "${comment}")
+    private Date tzdate;
+    /** 制定者 */
+    @ApiModelProperty(value = "${comment}")
+    private String zdzno;
+    /** 备注 */
+    @ApiModelProperty(value = "${comment}")
+    private String remark;
+    /** 状态 NA正常,CL不用,OP封存 */
+    @ApiModelProperty(value = "${comment}")
+    private String status;
+    /** Y/N */
+    @ApiModelProperty(value = "${comment}")
+    private String gxcp;
+    /** 集团助记码 */
+    @ApiModelProperty(value = "${comment}")
+    private String finkey;
+    /** 发货重量用电箱数量 */
+    @ApiModelProperty(value = "${comment}")
+    private Integer dxqty;
+    /** 有BOM否 */
+    @ApiModelProperty(value = "${comment}")
+    private String bomsta;
+    /** 合并替换码 */
+    @ApiModelProperty(value = "${comment}")
+    private String tpart;
+    /** Y:样品 N:量产,T:图号升级 */
+    @ApiModelProperty(value = "${comment}")
+    private String ypbz;
+    /** Y:样品 N:量产,T:图号升级保留最原始状态不变 */
+    @ApiModelProperty(value = "${comment}")
+    private String cptype;
+    /** 操作者 */
+    @ApiModelProperty(value = "${comment}")
+    private String writeruser;
+    /** 更新日期 */
+    @ApiModelProperty(value = "${comment}")
+    private Date writedate;
+    /** 变更信息 */
+    @ApiModelProperty(value = "${comment}")
+    private String remark1;
+    /** 变更信息 */
+    @ApiModelProperty(value = "${comment}")
+    private String remark2;
+    /** 客户简称 */
+    @ApiModelProperty(value = "${comment}")
+    private String khna;
+    /** 不同客户打印合格证图号不同 */
+    @ApiModelProperty(value = "${comment}")
+    private String drawh;
+    /** 金华德的实际投料重量 */
+    @ApiModelProperty(value = "${comment}")
+    private BigDecimal stqty;
+    /** 客户版本号 */
+    @ApiModelProperty(value = "${comment}")
+    private String khver;
+    /** 是否国六产品 */
+    @ApiModelProperty(value = "${comment}")
+    private String pfbz;
+    /** 是否氢能源产品 */
+    @ApiModelProperty(value = "${comment}")
+    private String qnbz;
+    /** 是否新能源产品 */
+    @ApiModelProperty(value = "${comment}")
+    private String xnbz;
+    /** "Manual"字符-- 人工区;Automatic字符代表智能区 */
+    @ApiModelProperty(value = "${comment}")
+    private String ktype;
+    /** 技术员 */
+    @ApiModelProperty(value = "${comment}")
+    private String jsyno;
+
+    @ApiModelProperty("修改时间")
+    private Date modate;
+}

+ 24 - 0
src/main/java/cn/ezhizao/project/business/mapper/Inc10100Mapper.java

@@ -0,0 +1,24 @@
+package cn.ezhizao.project.business.mapper;
+
+import cn.ezhizao.project.business.domain.Inc10100;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+import java.util.List;
+
+public interface Inc10100Mapper extends BaseMapper<Inc10100>
+{
+    /**
+     * 查询mrp10200列表
+     *
+     * @param inc10100 inc10100
+     * @return inc10100 集合
+     */
+    List<Inc10100> getList(Inc10100 inc10100);
+
+    /**
+     * 物理删除
+     * @param inc10100
+     * @return 删除结果
+     */
+    int physicalDelete(Inc10100 inc10100);
+}

+ 18 - 0
src/main/java/cn/ezhizao/project/business/service/IInc10100Service.java

@@ -0,0 +1,18 @@
+package cn.ezhizao.project.business.service;
+
+import cn.ezhizao.project.business.domain.Inc10100;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+public interface IInc10100Service extends IService<Inc10100>
+{
+    /**
+     * 查询mrp10200列表
+     *
+     * @param queryWrapper<Inc10100> queryWrapper
+     * @return mrp10200集合
+     */
+    List<Inc10100> getList(QueryWrapper<Inc10100> queryWrapper);
+
+}

+ 33 - 0
src/main/java/cn/ezhizao/project/business/service/impl/Inc10100ServiceImpl.java

@@ -0,0 +1,33 @@
+package cn.ezhizao.project.business.service.impl;
+
+import cn.ezhizao.framework.aspectj.lang.annotation.DataSource;
+import cn.ezhizao.framework.aspectj.lang.enums.DataSourceType;
+import cn.ezhizao.project.business.domain.Inc10100;
+import cn.ezhizao.project.business.mapper.Inc10100Mapper;
+import cn.ezhizao.project.business.service.IInc10100Service;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Service
+public class Inc10100ServiceImpl extends ServiceImpl<Inc10100Mapper, Inc10100> implements IInc10100Service
+{
+    @Resource
+    private Inc10100Mapper inc10100Mapper;
+
+    /**
+     * 查询mrp10200列表
+     *
+     * @param queryWrapper<Inc10100> queryWrapper
+     * @return mrp10200
+     */
+    @Override
+    @DataSource(value = DataSourceType.SLAVE)
+    public List<Inc10100> getList(QueryWrapper<Inc10100> queryWrapper)
+    {
+        return inc10100Mapper.selectList(queryWrapper);
+    }
+}

+ 4 - 0
src/main/java/cn/ezhizao/project/system/mapper/SysUserMapper.java

@@ -2,6 +2,8 @@ package cn.ezhizao.project.system.mapper;
 
 import cn.ezhizao.project.system.domain.SysUser;
 
+import java.util.List;
+
 /**
  * 用户表 数据层
  *
@@ -12,4 +14,6 @@ public interface SysUserMapper {
      * 根据userName查询userId
      */
     public SysUser getUserByCode(String userName);
+
+    public List<SysUser> selectUserList(SysUser user);
 }

+ 4 - 0
src/main/java/cn/ezhizao/project/system/service/ISysUserService.java

@@ -2,6 +2,8 @@ package cn.ezhizao.project.system.service;
 
 import cn.ezhizao.project.system.domain.SysUser;
 
+import java.util.List;
+
 /**
  * 用户 业务层
  *
@@ -16,4 +18,6 @@ public interface ISysUserService {
      * @return 用户信息
      */
     SysUser getUserByCode(String userName);
+
+    List<SysUser> getList();
 }

+ 7 - 0
src/main/java/cn/ezhizao/project/system/service/impl/SysUserServiceImpl.java

@@ -8,6 +8,8 @@ import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.util.List;
+
 /**
  * 用户 业务层处理
  *
@@ -23,4 +25,9 @@ public class SysUserServiceImpl implements ISysUserService {
     public SysUser getUserByCode(String userName) {
         return userMapper.getUserByCode(userName);
     }
+
+    @Override
+    public List<SysUser> getList() {
+        return userMapper.selectUserList(new SysUser());
+    }
 }

+ 30 - 0
src/main/resources/mybatis/business/Inc10100Mapper.xml

@@ -0,0 +1,30 @@
+<?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="cn.ezhizao.project.business.mapper.Inc10100Mapper">
+
+    <resultMap type="cn.ezhizao.project.business.domain.Inc10100" id="Inc10100Result">
+        <id column="id" property="id"/>
+    </resultMap>
+
+
+    <select id="getList" parameterType="Inc10100" resultMap="Inc10100Result">
+        SELECT *
+        FROM (
+        SELECT
+        ROW_NUMBER() OVER (ORDER BY txcode, docno, docseq) AS RowNum, *
+        FROM inc10100
+        ) AS inc10100
+        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
+            <if test="facno != null  and facno != ''"> AND facno = #{facno}</if>
+            <if test="part != null  and part != ''"> AND part = #{part}</if>
+            <if test="prloc != null  and prloc != ''"> AND prloc = #{prloc}</if>
+            <if test="type != null  and type != ''"> AND type = #{type}</if>
+            <if test="writeruser != null  and writeruser != ''"> AND writeruser = #{writeruser}</if>
+            <if test="writedate != null "> AND writedate = #{writedate}</if>
+            <if test="modate != null"> AND modate > #{modate}</if>
+            <if test="status != null"> AND status = #{status}</if>
+        </trim>
+    </select>
+</mapper>