Fancy
2024-08-19 481ad6dfcad7bc346db4bc1abcdf24d5134b301b
order manage
7个文件已修改
172 ■■■■■ 已修改文件
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrOrderItemMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrOrderMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrder.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrderItem.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/resources/mapper/PrOrderMapper.xml 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/screen/ScreenReportSv.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrOrderItemMapper.java
@@ -1,5 +1,6 @@
package com.dy.pmsGlobal.daoPr;
import com.dy.pmsGlobal.pojoPlt.PltProductParams;
import com.dy.pmsGlobal.pojoPr.PrOrderItem;
import org.apache.ibatis.annotations.Mapper;
@@ -14,6 +15,8 @@
    int deleteByPrimaryKey(Long id);
    int insert(PrOrderItem record);
    int insertSelective(PrOrderItem record);
    PrOrderItem selectByPrimaryKey(Long id);
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPr/PrOrderMapper.java
@@ -1,7 +1,12 @@
package com.dy.pmsGlobal.daoPr;
import com.dy.pmsGlobal.pojoPlt.PltProduct;
import com.dy.pmsGlobal.pojoPr.PrOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @author User
@@ -14,10 +19,19 @@
    int deleteByPrimaryKey(Long id);
    int deleteLogicById(Long id);
    int insertSelective(PrOrder record);
    PrOrder selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(PrOrder record);
    Long selectSomeCount(Map<String, Object> params);
    List<PrOrder> selectSome(Map<String, Object> params);
    List<PrOrder> selectAll(Map<String, Object> params);
    boolean exists(@Param("name") String name, @Param("id") Long id);
    int updateByPrimaryKeySelective(PrOrder record);
}
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrder.java
@@ -2,15 +2,18 @@
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import java.util.Date;
import java.util.List;
/**
@@ -25,14 +28,15 @@
public class PrOrder implements BaseEntity {
    /**
    *
    * 主键
    */
    @NotNull(message="不能为空")
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    @TableId(value = "id", type = IdType.INPUT)
    public Long id;
    /**
    * 名称
    */
    @NotEmpty(message = "名称不能为空")
    public String name;
    /**
    * 客户名称
@@ -65,11 +69,14 @@
    /**
    * 是否删除,1是,0否
    */
    public Integer deleted;
    @JSONField(serialize = false)
    public Boolean deleted;
    /**
    * 备注
    */
    public String remark;
    @NotNull(message = "订单项不能为空")
    public List<PrOrderItem> items;
}
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrderItem.java
@@ -8,9 +8,6 @@
import jakarta.validation.constraints.NotNull;
import lombok.*;
/**
* @TableName pr_order_item
@@ -26,7 +23,6 @@
    /**
    * 编号
    */
    @NotNull(message="编号不能为空")
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    public Long id;
    /**
@@ -34,6 +30,12 @@
    */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    public Long orderId;
    /**
     * 产品实体编号
     */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    public Long proId;
    /**
    * 生产数量
    */
@@ -43,5 +45,7 @@
    */
    public Integer completeNumber;
    @JSONField(serialize = false)
    public Boolean deleted;
}
pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml
@@ -7,13 +7,15 @@
    <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoPr.PrOrderItem">
            <id property="id" column="id" jdbcType="BIGINT"/>
            <result property="orderId" column="order_id" jdbcType="BIGINT"/>
            <result property="proId"  column="pro_id" jdbcType="BIGINT"/>
            <result property="number" column="number" jdbcType="INTEGER"/>
            <result property="completeNumber" column="complete_number" jdbcType="INTEGER"/>
            <result column="deleted" property="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler" />
    </resultMap>
    <sql id="Base_Column_List">
        id,order_id,number,
        complete_number
        id,order_id,pro_id,number,
        complete_number, deleted
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -22,24 +24,42 @@
        from pr_order_item
        where  id = #{id,jdbcType=BIGINT} 
    </select>
    <select id="selectItems"  parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from pr_order_item
        where order_id = #{orderId,jdbcType=BIGINT} and deleted !=1
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from pr_order_item
        where  id = #{id,jdbcType=BIGINT} 
    </delete>
    <insert id="insert" parameterType="com.dy.pmsGlobal.pojoPr.PrOrderItem">
        <!--@mbg.generated-->
        insert into pr_order_item ( id,order_id,pro_id,number,
        complete_number, deleted
        )
        values (#{id,jdbcType=BIGINT},#{orderId,jdbcType=BIGINT}, #{proId,jdbcType=BIGINT}, #{number,jdbcType=INTEGER},
        #{completeNumber,jdbcType=INTEGER}, #{deleted,jdbcType=TINYINT}
        )
    </insert>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrOrderItem" useGeneratedKeys="true">
        insert into pr_order_item
        <trim prefix="(" suffix=")" suffixOverrides=",">
                <if test="id != null">id,</if>
                <if test="orderId != null">order_id,</if>
                <if test="proId != null">pro_id,</if>
                <if test="number != null">number,</if>
                <if test="completeNumber != null">complete_number,</if>
                <if test="deleted != null">deleted,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                <if test="id != null">#{id,jdbcType=BIGINT},</if>
                <if test="orderId != null">#{orderId,jdbcType=BIGINT},</if>
                <if test="proId != null">#{proId,jdbcType=BIGINT},</if>
                <if test="number != null">#{number,jdbcType=INTEGER},</if>
                <if test="completeNumber != null">#{completeNumber,jdbcType=INTEGER},</if>
                <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrOrderItem">
@@ -48,12 +68,18 @@
                <if test="orderId != null">
                    order_id = #{orderId,jdbcType=BIGINT},
                </if>
                <if test="proId != null">
                    pro_id = #{proId,jdbcType=BIGINT},
                </if>
                <if test="number != null">
                    number = #{number,jdbcType=INTEGER},
                </if>
                <if test="completeNumber != null">
                    complete_number = #{completeNumber,jdbcType=INTEGER},
                </if>
                <if test="deleted != null">
                    deleted = #{deleted,jdbcType=TINYINT},
                </if>
        </set>
        where   id = #{id,jdbcType=BIGINT} 
    </update>
pms-parent/pms-global/src/main/resources/mapper/PrOrderMapper.xml
@@ -17,7 +17,9 @@
            <result property="deleted" column="deleted" jdbcType="TINYINT"/>
            <result property="remark" column="remark" jdbcType="VARCHAR"/>
    </resultMap>
    <resultMap id="BaseResultMap2" type="com.dy.pmsGlobal.pojoPr.PrOrder" extends="BaseResultMap">
        <collection property="items" ofType="com.dy.pmsGlobal.pojoPr.PrOrderItem" fetchType="eager" select="selectItems" column="id" />
    </resultMap>
    <sql id="Base_Column_List">
        id,name,customer_name,
        director,d_mobile,delivery_date,
@@ -32,10 +34,98 @@
        where  id = #{id,jdbcType=BIGINT} 
    </select>
    <select id="exists" resultType="java.lang.Boolean">
        select count(1) from pr_order where name = #{name}
        <if test="id != null">
            and id != #{id}
        </if>
    </select>
    <select id="selectSome" resultMap="BaseResultMap2">
        select
        <include refid="Base_Column_List" />
        from pr_order p
        where p.deleted!=1
        <trim prefix="and " suffixOverrides="and">
            <if test="name != null and name != ''">
                name like concat('%', #{name}, '%') and
            </if>
            <if test="customerName != null and customerName != ''">
                customer_name like concat('%', #{customerName}, '%') and
            </if>
            <if test="director != null and director != ''">
                director like concat('%', #{director}, '%') and
            </if>
            <if test="startTime != null">
                and out_time <![CDATA[ > ]]> #{startTime,jdbcType=TIMESTAMP}
            </if>
            <if test="endTime != null">
                and out_time <![CDATA[ < ]]> #{endTime,jdbcType=TIMESTAMP}
            </if>
        </trim>
        order by id desc
        <trim prefix="limit " >
            <if test="start != null and count != null">
                #{start}, #{count}
            </if>
        </trim>
    </select>
    <select id="selectSomeCount" resultType="java.lang.Long">
        select count(1)
        from pr_order p
        where p.deleted!=1
        <trim prefix="and " suffixOverrides="and">
            <if test="name != null and name != ''">
                name like concat('%', #{name}, '%') and
            </if>
            <if test="customerName != null and customerName != ''">
                customer_name like concat('%', #{customerName}, '%') and
            </if>
            <if test="director != null and director != ''">
                director like concat('%', #{director}, '%') and
            </if>
            <if test="startTime != null">
                and out_time <![CDATA[ > ]]> #{startTime,jdbcType=TIMESTAMP}
            </if>
            <if test="endTime != null">
                and out_time <![CDATA[ < ]]> #{endTime,jdbcType=TIMESTAMP}
            </if>
        </trim>
    </select>
    <select id="selectAll" resultType="com.dy.pmsGlobal.pojoPr.PrOrder">
        select
        <include refid="Base_Column_List" />
        from pr_order p
        where p.deleted!=1
        <trim prefix="and " suffixOverrides="and">
            <if test="name != null and name != ''">
                name like concat('%', #{name}, '%') and
            </if>
            <if test="customerName != null and customerName != ''">
                customer_name like concat('%', #{customerName}, '%') and
            </if>
            <if test="director != null and director != ''">
                director like concat('%', #{director}, '%') and
            </if>
            <if test="startTime != null">
                and out_time <![CDATA[ > ]]> #{startTime,jdbcType=TIMESTAMP}
            </if>
            <if test="endTime != null">
                and out_time <![CDATA[ < ]]> #{endTime,jdbcType=TIMESTAMP}
            </if>
        </trim>
        order by id desc
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        delete from pr_order
        where  id = #{id,jdbcType=BIGINT} 
    </delete>
    <update id="deleteLogicById" parameterType="java.lang.Long">
        update pr_order set deleted = 1
        where id = #{id}
    </update>
    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrOrder" useGeneratedKeys="true">
        insert into pr_order
        <trim prefix="(" suffix=")" suffixOverrides=",">
pms-parent/pms-web-other/src/main/java/com/dy/pmsOther/screen/ScreenReportSv.java
@@ -98,6 +98,4 @@
        Date date = Date.from(dt.atZone(ZoneId.systemDefault()).toInstant());
        return date;
    }
}