浏览代码

小程序API

caozj 2 年之前
父节点
当前提交
325e724c14

+ 172 - 0
hx-service-api/storage-api/src/main/java/com/fjhx/entity/material/Material.java

@@ -0,0 +1,172 @@
+package com.fjhx.entity.material;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.Version;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fjhx.base.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fjhx.base.BasicEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 物料
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-07-20
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class Material extends BasicEntity {
+
+
+    /**
+     * 软删除
+     */
+    @TableField("IsDelete")
+    private Boolean isdelete;
+
+    /**
+     * 物料名称
+     */
+    @TableField("Name")
+    private String name;
+
+    /**
+     * 编码
+     */
+    @TableField("Code")
+    private String code;
+
+    /**
+     * 克重
+     */
+    @TableField("UnitWeight")
+    private Float unitweight;
+
+    /**
+     * 单位编号
+     */
+    @TableField("MaterialUnitID")
+    private String materialunitid;
+
+    /**
+     * 库存单位id
+     */
+    @TableField("StockUnitID")
+    private String stockunitid;
+
+    /**
+     * 门幅
+     */
+    @TableField("Width")
+    private Float width;
+
+    /**
+     * 分类
+     */
+    @TableField("CategoryCode")
+    private String categorycode;
+
+    /**
+     * 安全库存
+     */
+    @TableField("SafetyStock")
+    private Integer safetystock;
+
+    /**
+     * 定时任务自动生成申购单时间
+     */
+    @TableField("AutoTaskTime")
+    private Date autotasktime;
+
+    /**
+     * 抽检⽐例
+     */
+    @TableField("CheckRate")
+    private BigDecimal checkrate;
+
+    /**
+     * 安全预警天数/采购周期
+     */
+    @TableField("SafetyWarnDay")
+    private Integer safetywarnday;
+
+    /**
+     * 规格
+     */
+    @TableField("Spec")
+    private String spec;
+
+    /**
+     * 放置区域
+     */
+    @TableField("PlaceAreaIds")
+    private String placeareaids;
+
+    /**
+     * 滞留周期(天)
+     */
+    @TableField("DelayPeriod")
+    private Integer delayperiod;
+
+    /**
+     * 维护人员
+     */
+    @TableField("CreateUser")
+    private String createuser;
+
+    /**
+     * 组织架构
+     */
+    @TableField("OR_ID")
+    private String orId;
+
+    /**
+     * 物料其他编码(模糊搜索使用)
+     */
+    @TableField("OtherCode")
+    private String othercode;
+
+    /**
+     * 备注
+     */
+    @TableField("Remark")
+    private String remark;
+
+    /**
+     * 标准价格
+     */
+    @TableField("Price")
+    private BigDecimal price;
+
+    /**
+     * 标准库存
+     */
+    @TableField("StockStandard")
+    private BigDecimal stockstandard;
+
+    /**
+     * 单位数量
+     */
+    @TableField("UnitNum")
+    private BigDecimal unitnum;
+
+    /**
+     * 用途
+     */
+    @TableField("Purpose")
+    private String purpose;
+
+    /**
+     * 工艺类型 (枚举定义:0=直喷,1=热转,2=打纸,3=墨水,4=其他)
+     */
+    @TableField("TechnologyType")
+    private Integer technologytype;
+
+
+}

+ 43 - 0
hx-service/storage/src/main/java/com/fjhx/material/controller/MaterialController.java

@@ -0,0 +1,43 @@
+package com.fjhx.material.controller;
+
+import com.fjhx.base.ListPageMap;
+import org.springblade.core.tool.api.R;
+import com.fjhx.entity.material.Material;
+import com.fjhx.material.service.MaterialService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 物料 前端控制器
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-07-20
+ */
+@RestController
+@RequestMapping("/material")
+public class MaterialController {
+
+    @Autowired
+    private MaterialService materialService;
+
+    /**
+     * 下拉物料
+     * @param condition
+     * @return
+     */
+    @PostMapping("/selectList")
+    public R selectList(@RequestBody Map<String, Object> condition){
+        ListPageMap.getListPageMap(condition);
+        List<Material> list = materialService.selectList(condition);
+        return R.success(list);
+    }
+}
+

+ 30 - 0
hx-service/storage/src/main/java/com/fjhx/material/mapper/MaterialMapper.java

@@ -0,0 +1,30 @@
+package com.fjhx.material.mapper;
+
+import com.fjhx.entity.material.Material;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fjhx.entity.supplier.Supplier;
+import org.springblade.core.tenant.annotation.TenantIgnore;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 物料 Mapper 接口
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-07-20
+ */
+public interface MaterialMapper extends BaseMapper<Material> {
+
+    /**
+     * 下拉列表
+     *
+     * @param condition
+     * @return
+     */
+    @TenantIgnore
+    List<Material> selectList(Map<String, Object> condition);
+
+}

+ 22 - 0
hx-service/storage/src/main/java/com/fjhx/material/mapper/MaterialMapper.xml

@@ -0,0 +1,22 @@
+<?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="com.fjhx.material.mapper.MaterialMapper">
+
+    <select id="selectList" resultType="com.fjhx.entity.material.Material">
+        SELECT
+        *
+        FROM
+        material t1
+        <include refid="list_condition"/>
+        ORDER BY CreatedTime DESC
+        <include refid="com.fjhx.supplier.mapper.SupplierMapper.sql_limit"/>
+    </select>
+    <sql id="list_condition">
+        <where>
+            t1.IsDelete = 0
+            <if test="search neq null and search neq '' ">
+                AND (INSTR(t1.`Name`, #{search}) > 0)
+            </if>
+        </where>
+    </sql>
+</mapper>

+ 27 - 0
hx-service/storage/src/main/java/com/fjhx/material/service/MaterialService.java

@@ -0,0 +1,27 @@
+package com.fjhx.material.service;
+
+import com.fjhx.entity.material.Material;
+import com.fjhx.base.BaseService;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 物料 服务类
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-07-20
+ */
+public interface MaterialService extends BaseService<Material> {
+
+
+    /**
+     * 下拉列表
+     *
+     * @param condition
+     * @return
+     */
+    List<Material> selectList(Map<String, Object> condition);
+}

+ 34 - 0
hx-service/storage/src/main/java/com/fjhx/material/service/impl/MaterialServiceImpl.java

@@ -0,0 +1,34 @@
+package com.fjhx.material.service.impl;
+
+
+import com.fjhx.entity.material.Material;
+import com.fjhx.material.mapper.MaterialMapper;
+import com.fjhx.material.service.MaterialService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 物料 服务实现类
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-07-20
+ */
+@Service
+public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> implements MaterialService {
+
+
+    /**
+     * 下拉列表
+     * @param condition
+     * @return
+     */
+    @Override
+    public List<Material> selectList(Map<String, Object> condition) {
+        return baseMapper.selectList(condition);
+    }
+}

+ 1 - 1
hx-service/storage/src/main/java/com/fjhx/supplier/controller/SupplierController.java

@@ -206,7 +206,7 @@ public class SupplierController {
      * @param condition
      * @return
      */
-    @GetMapping("/selectList")
+    @PostMapping("/selectList")
     public R selectList(@RequestBody Map<String, Object> condition){
         ListPageMap.getListPageMap(condition);
         List<Supplier> list = supplierService.selectList(condition);

+ 1 - 1
hx-service/storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.xml

@@ -201,7 +201,7 @@
         SELECT
             *
         FROM
-            supplier
+            supplier t1
         <include refid="list_condition"/>
         ORDER BY CreatedTime DESC
         <include refid="sql_limit"/>