guoyuji
2024-02-21 e4d55b12053c4da904adeef2c05c36fb4135cdb3
订单工艺审核部分功能
18个文件已修改
129 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/order/UpdateOrderCraft.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/sd/OrderController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/sd/Order.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/sd/BasicDateMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderGlassDetailMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/sd/BasicDateService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/BasicData.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/OrderGlassDetailMapper.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/test/java/com/example/erp/ErpApplicationTests.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/test/java/com/example/erp/service/sd/OrderServiceTest.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/sd/BasicData.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/sd/OrderGlassDetailMapper.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/sd/OrderMapper.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
@@ -546,7 +546,7 @@
        <el-col  :span="2"><el-text>计算方式:</el-text></el-col>
        <el-col  :span="2">
          <el-select v-model="titleUploadData.calculateType"  clearable placeholder=" " >
            <el-option value="1" label="1"/>
            <el-option value="1" label="面积金额(单片)"/>
          </el-select>
        </el-col>
        <el-col  :span="2"><el-text>*业务员:</el-text></el-col>
north-glass-erp/northglass-erp/src/views/sd/order/UpdateOrderCraft.vue
@@ -37,7 +37,7 @@
  },//表头参数
  columns:[
    {title: '操作', width: 110, slots: { default: 'button_slot' },fixed:"left",},
    {field: 'orderDetail.orderNumber',width:120,  title: '序号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'orderNumber',width:120,  title: '序号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    //{field: 'orderDetail.buildingNumber',width:120,  title: '楼号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'orderDetail.productName',width:120,  title: '成品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'glassAddress',width:120,  title: '标记',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
@@ -56,13 +56,13 @@
    {field: 'orderDetail.edgingType',width:120,  title: '磨边类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}
  ],//表头按钮
  mergeCells: [
    { row: 0, col: 1, rowspan: 4, colspan: 1 },
    /*{ row: 0, col: 1, rowspan: 4, colspan: 1 },
    { row: 0, col: 2, rowspan: 4, colspan: 1 },
    { row: 0, col: 4, rowspan: 4, colspan: 1 },
    { row: 0, col: 5, rowspan: 4, colspan: 1 },
    { row: 0, col: 6, rowspan: 4, colspan: 1 },
    { row: 0, col: 7, rowspan: 4, colspan: 1 },
    { row: 0, col: 8, rowspan: 4, colspan: 1 },
    { row: 0, col: 8, rowspan: 4, colspan: 1 },*/
  ],
  toolbarConfig: {
    buttons: [
@@ -178,7 +178,8 @@
  })
})
const reviewOrderCraft = (state) => {
  request.post(`/order/reviewProcessById/${titleUploadData.value.orderId}/${state}`).then(res =>{
  request.post(`/order/reviewProcessById/${titleUploadData.value.orderId}/${state}`,xGrid.value.getRecordset().updateRecords).then(res =>{
    if(res.code==200){
      gridOptions.toolbarConfig.buttons[2].disabled = true
      if(state==2){
north-glass-erp/src/main/java/com/example/erp/controller/sd/OrderController.java
@@ -3,6 +3,7 @@
import com.example.erp.common.Constants;
import com.example.erp.common.Result;
import com.example.erp.entity.sd.Order;
import com.example.erp.entity.sd.OrderGlassDetail;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.sd.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -57,7 +58,7 @@
    @PostMapping("/reviewProcessById/{id}/{status}")
    public Result reviewProcessById(@PathVariable String id,@PathVariable Integer status)  {
        return  Result.seccess(orderService.reviewProcessById(id,status));
    public Result reviewProcessById(@PathVariable String id,@PathVariable Integer status,@RequestBody List<OrderGlassDetail> orderGlassDetails)  {
        return  Result.seccess(orderService.reviewProcessById(id,status,orderGlassDetails));
    }
}
north-glass-erp/src/main/java/com/example/erp/entity/sd/Order.java
@@ -58,6 +58,7 @@
    @TableField(value = "customer_id")
    private Customer  customer;
    @TableField(select = false)
    private FinishedGoodsInventory finishedGoodsInventory;
}
north-glass-erp/src/main/java/com/example/erp/mapper/sd/BasicDateMapper.java
@@ -11,6 +11,6 @@
@Mapper
public interface BasicDateMapper {
    List<BasicData> getOrderBasicData();
    List<String> getOrderBasicDataType();
    List<BasicData> getOrderBasicData(String type);
    List<String> getOrderBasicDataType(String type);
}
north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderGlassDetailMapper.java
@@ -15,4 +15,6 @@
    List<OrderGlassDetail> selectOrderGlassDetail(@Param("orderId") String orderId);
    List<OrderGlassDetail> selectOrderGlassDetailByOrderId(@Param("orderId") String orderId);
    void updateSizeAndProcess(@Param("orderGlassDetails")List<OrderGlassDetail> orderGlassDetails);
}
north-glass-erp/src/main/java/com/example/erp/service/sd/BasicDateService.java
@@ -22,9 +22,9 @@
    //获取订单基本数据
public Map<String, List<Object>> getOrderBasicData() {
        //获取订单基本数据类型
        List<String> orderBasicDataType = basicDateMapper.getOrderBasicDataType();
        List<String> orderBasicDataType = basicDateMapper.getOrderBasicDataType("order");
        //获取订单基本数据
        List<BasicData> orderBasicData = basicDateMapper.getOrderBasicData();
        List<BasicData> orderBasicData = basicDateMapper.getOrderBasicData("order");
        //创建Map对象
        Map<String, List<Object>> orderBasicDataMap = new HashMap<>(); ;
        //创建List对象
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
@@ -164,7 +164,7 @@
        map.put("selectDate",list);
        return map;
    }
    //删除订单
    public Integer deleteOrder(String id) {
        return  orderMapper.delete(
                new QueryWrapper<Order>().eq("order_id",id)
@@ -181,7 +181,7 @@
        map.put("orderDetails",orderDetails);
        return map;
    }
    //订单审核
    public boolean reviewOrderById(String id,Integer status) {
        Order order = orderMapper.selectOne(new QueryWrapper<Order>().eq("order_id",id));
        if(order.getProcessReview()!=2){
@@ -189,11 +189,21 @@
        }
        return orderMapper.reviewOrderById(id,status);
    }
    //工艺审核界面审核更新数据
    public boolean reviewProcessById(String id, Integer status,List<OrderGlassDetail> orderGlassDetails) {
        if(!orderGlassDetails.isEmpty() && status==2){
            orderGlassDetailMapper.updateSizeAndProcess(orderGlassDetails);
            orderProcessDetailMapper.delete(new QueryWrapper<OrderProcessDetail>().eq("order_id",id));
            //查询订单小片表获取工艺传入小片工艺表
            List<OrderGlassDetail> orderGlassDetailList = orderGlassDetailMapper.selectOrderGlassDetail(id);
            List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetailList);
            //赋值订单工艺表
            orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList);
        }
    public boolean reviewProcessById(String id, Integer status) {
        return orderMapper.reviewProcessById(id,status);
    }
    //工艺审核界面数据查询
    public Map<String,Object> getOrderCraftById(String id) {
        Order order = orderMapper.selectOne(new QueryWrapper<Order>().eq("order_id",id));
        List<OrderGlassDetail> orderGlassDetails = orderGlassDetailMapper.selectOrderGlassDetailByOrderId(id);
north-glass-erp/src/main/resources/application.yml
@@ -15,7 +15,7 @@
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
        sd:
          url: jdbc:mysql://10.153.19.150:3306/sd?serverTimezone=GMT%2b8
          url: jdbc:mysql://10.153.19.150:3306/sd?serverTimezone=GMT%2b8&allowMultiQueries=true
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
north-glass-erp/src/main/resources/mapper/sd/BasicData.xml
@@ -8,14 +8,14 @@
            *
        from
            basic_data as a
        where a.basic_type='order'
        where a.basic_type=#{type}
    </select>
    <select id="getOrderBasicDataType">
        select
            a.basic_category
        from
            basic_data as a
        where a.basic_type='order'
        where a.basic_type=#{type}
        group by  a.basic_category
    </select>
north-glass-erp/src/main/resources/mapper/sd/OrderGlassDetailMapper.xml
@@ -42,6 +42,7 @@
    <resultMap id="orderGlassDetailMap" type="com.example.erp.entity.sd.OrderGlassDetail" >
        <id column="id" property="id"/>
        <result column="order_id" property="orderId"/>
        <result column="order_number" property="orderNumber"/>
        <result column="glass_address" property="glassAddress"/>
        <result column="technology_number" property="technologyNumber"/>
        <result column="glass_child" property="glassChild"/>
@@ -50,7 +51,7 @@
        <result column="process" property="process"/>
        <!--接收其他外键实体类数据-->
        <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail">
            <result column="order_number" property="orderNumber"/>
            <result column="building_number" property="buildingNumber"/>
            <result column="product_name" property="productName"/>
@@ -71,7 +72,7 @@
    <select id="selectOrderGlassDetailByOrderId"  resultMap="orderGlassDetailMap">
        select
            a.order_id,
            b.order_number,
            a.order_number,
            b.building_number,
            b.product_name,
            a.glass_address,
@@ -95,4 +96,19 @@
        where a.order_id = #{orderId}
        order by a.order_number,a.technology_number
    </select>
    <update id="updateSizeAndProcess" parameterType="java.util.List">
        <foreach collection="orderGlassDetails"  item="item" index="index" open="" close="" separator=";">
            update order_glass_detail
            set
                child_width = #{item.childWidth},
                child_height = #{item.childHeight},
                process = #{item.process}
            where
                order_id = #{item.orderId}
                and order_number = #{item.orderNumber}
                and technology_number = #{item.technologyNumber}
        </foreach>
    </update>
</mapper>
north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
@@ -44,10 +44,10 @@
           </if>
           <if test="order.customerId != null and order.customerId != ''">
               and o.customer_id REGEXP #{customerId}
               and o.customer_id REGEXP #{order.customerId}
           </if>
           <if test="order.customerName != null and order.customerName != ''">
               and o.customer_name REGEXP #{customerName}
               and o.customer_name REGEXP #{order.customerName}
           </if>
           <if test="order.project != null and order.project != ''">
               and o.project REGEXP #{order.project}
@@ -60,7 +60,7 @@
           </if>
           <if test="order.area != null and order.area != ''">
               and o.area REGEXP #{order.area}
               and o.area REGEXP REGEXP_REPLACE(#{order.area}, '\\.0+$', '')
           </if>
           <if test="order.createTime != null and order.createTime != ''">
               and date(o.create_time) = #{order.createTime}
@@ -111,10 +111,10 @@
            </if>
            <if test="order.customerId != null and order.customerId != ''">
                and o.customer_id REGEXP #{customerId}
                and o.customer_id REGEXP #{order.customerId}
            </if>
            <if test="order.customerName != null and order.customerName != ''">
                and o.customer_name REGEXP #{customerName}
                and o.customer_name REGEXP #{order.customerName}
            </if>
            <if test="order.project != null and order.project != ''">
                and o.project REGEXP #{order.project}
north-glass-erp/src/test/java/com/example/erp/ErpApplicationTests.java
@@ -8,6 +8,7 @@
    @Test
    void contextLoads() {
        String.valueOf("1.0").replaceAll("\\.0*$|(\\.\\d*?)0+$", "$1");
    }
}
north-glass-erp/src/test/java/com/example/erp/service/sd/OrderServiceTest.java
@@ -19,11 +19,12 @@
    @Test
    void testCreateOrder() {
        List<LocalDate> a = new ArrayList<>();
        a.add(LocalDate.now().minusDays(15));
        a.add(LocalDate.now().plusDays(1));
        Order order = new Order();
        orderService.getOrderList(1,100,a,order,null);
        System.out.println(String.valueOf("2.10").replaceAll("\\.0*$|(\\.\\d*?)0+$", "$1"));
//        List<LocalDate> a = new ArrayList<>();
//        a.add(LocalDate.now().minusDays(15));
//        a.add(LocalDate.now().plusDays(1));
//        Order order = new Order();
//        orderService.getOrderList(1,100,a,order,null);
    }
}
north-glass-erp/target/classes/application.yml
@@ -15,7 +15,7 @@
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
        sd:
          url: jdbc:mysql://10.153.19.150:3306/sd?serverTimezone=GMT%2b8
          url: jdbc:mysql://10.153.19.150:3306/sd?serverTimezone=GMT%2b8&allowMultiQueries=true
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
north-glass-erp/target/classes/mapper/sd/BasicData.xml
@@ -8,14 +8,14 @@
            *
        from
            basic_data as a
        where a.basic_type='order'
        where a.basic_type=#{type}
    </select>
    <select id="getOrderBasicDataType">
        select
            a.basic_category
        from
            basic_data as a
        where a.basic_type='order'
        where a.basic_type=#{type}
        group by  a.basic_category
    </select>
north-glass-erp/target/classes/mapper/sd/OrderGlassDetailMapper.xml
@@ -42,6 +42,7 @@
    <resultMap id="orderGlassDetailMap" type="com.example.erp.entity.sd.OrderGlassDetail" >
        <id column="id" property="id"/>
        <result column="order_id" property="orderId"/>
        <result column="order_number" property="orderNumber"/>
        <result column="glass_address" property="glassAddress"/>
        <result column="technology_number" property="technologyNumber"/>
        <result column="glass_child" property="glassChild"/>
@@ -50,7 +51,7 @@
        <result column="process" property="process"/>
        <!--接收其他外键实体类数据-->
        <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail">
            <result column="order_number" property="orderNumber"/>
            <result column="building_number" property="buildingNumber"/>
            <result column="product_name" property="productName"/>
@@ -71,7 +72,7 @@
    <select id="selectOrderGlassDetailByOrderId"  resultMap="orderGlassDetailMap">
        select
            a.order_id,
            b.order_number,
            a.order_number,
            b.building_number,
            b.product_name,
            a.glass_address,
@@ -95,4 +96,19 @@
        where a.order_id = #{orderId}
        order by a.order_number,a.technology_number
    </select>
    <update id="updateSizeAndProcess" parameterType="java.util.List">
        <foreach collection="orderGlassDetails"  item="item" index="index" open="" close="" separator=";">
            update order_glass_detail
            set
                child_width = #{item.childWidth},
                child_height = #{item.childHeight},
                process = #{item.process}
            where
                order_id = #{item.orderId}
                and order_number = #{item.orderNumber}
                and technology_number = #{item.technologyNumber}
        </foreach>
    </update>
</mapper>
north-glass-erp/target/classes/mapper/sd/OrderMapper.xml
@@ -44,10 +44,10 @@
           </if>
           <if test="order.customerId != null and order.customerId != ''">
               and o.customer_id REGEXP #{customerId}
               and o.customer_id REGEXP #{order.customerId}
           </if>
           <if test="order.customerName != null and order.customerName != ''">
               and o.customer_name REGEXP #{customerName}
               and o.customer_name REGEXP #{order.customerName}
           </if>
           <if test="order.project != null and order.project != ''">
               and o.project REGEXP #{order.project}
@@ -60,7 +60,7 @@
           </if>
           <if test="order.area != null and order.area != ''">
               and o.area REGEXP #{order.area}
               and o.area REGEXP REGEXP_REPLACE(#{order.area}, '\\.0+$', '')
           </if>
           <if test="order.createTime != null and order.createTime != ''">
               and date(o.create_time) = #{order.createTime}
@@ -111,10 +111,10 @@
            </if>
            <if test="order.customerId != null and order.customerId != ''">
                and o.customer_id REGEXP #{customerId}
                and o.customer_id REGEXP #{order.customerId}
            </if>
            <if test="order.customerName != null and order.customerName != ''">
                and o.customer_name REGEXP #{customerName}
                and o.customer_name REGEXP #{order.customerName}
            </if>
            <if test="order.project != null and order.project != ''">
                and o.project REGEXP #{order.project}