廖井涛
2024-03-07 931d09c45536ceb5a2b0afe8f69699318a0487d6
修改补片界面
7个文件已修改
1个文件已添加
157 ■■■■■ 已修改文件
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReplenishController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/PatchLogMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReplenishService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReworkService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ReworkMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/PatchLogMapper.xml 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/ReworkMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReplenishController.java
@@ -50,7 +50,7 @@
        }
    }
    @ApiOperation("订单调拨接口")
    @ApiOperation("补片审核接口")
    @PostMapping("/updateReplenish")
    public Result updateReplenish( @RequestBody Map<String,Object> object){
        if(replenishService.updateReplenish(object)){
north-glass-erp/src/main/java/com/example/erp/mapper/pp/PatchLogMapper.java
@@ -26,6 +26,8 @@
    Boolean updateReplenish(@Param("patchLog") PatchLog patchLog ,  @Param("userName") String userName);
    Boolean updateOrderProcessDetail(@Param("patchLog") PatchLog patchLog );
    List<Map<String,Object>> getSelectReplenish(@Param("offset") Integer offset, @Param("pageSize") Integer pageSiz);
north-glass-erp/src/main/java/com/example/erp/service/pp/ReplenishService.java
@@ -11,6 +11,7 @@
import com.example.erp.service.userInfo.SysErrorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.text.SimpleDateFormat;
@@ -20,6 +21,7 @@
@Service
@DS("pp")
@Transactional(rollbackFor = Exception.class)
public class ReplenishService {
    @Autowired
    PatchLogMapper patchMapper;
@@ -112,6 +114,8 @@
            for (PatchLog patchLog : patchLoglist) {
                //审核
                patchMapper.updateReplenish(patchLog,userName);
                //修改小片流程卡数量
                patchMapper.updateOrderProcessDetail(patchLog);
            }
        }
north-glass-erp/src/main/java/com/example/erp/service/pp/ReworkService.java
@@ -14,6 +14,7 @@
import com.example.erp.service.userInfo.SysErrorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.text.SimpleDateFormat;
@@ -23,6 +24,7 @@
@Service
@DS("pp")
@Transactional(rollbackFor = Exception.class)
public class ReworkService {
    @Autowired
    ReworkMapper reworkMapper;
north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml
@@ -88,6 +88,10 @@
        update pp.patch_log set reviewer=#{userName},review_status=1,update_time=now() where id=#{patchLog.id}
    </update>
    <update id="updateOrderProcessDetail"  >
        update pp.patch_log set reviewer=#{userName},review_status=1,update_time=now() where id=#{patchLog.id}
    </update>
    <update id="updateDamageDetails"  >
        update pp.damage_details set quantity=quantity+#{patchLog.patchNum},patch_status=1 where id=#{patchLog.reviewer}
    </update>
@@ -129,7 +133,7 @@
                 left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
                           on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=0
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=0 and (dd.responsible_process=rw.this_process or (dd.responsible_process!=rw.this_process and dd.qualityIns_status=1))
    </select>
north-glass-erp/src/main/resources/mapper/pp/ReworkMapper.xml
@@ -98,7 +98,7 @@
                 left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
                           on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=1
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=1 and dd.qualityIns_status=1
    </select>
north-glass-erp/target/classes/mapper/pp/PatchLogMapper.xml
New file
@@ -0,0 +1,137 @@
<?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.example.erp.mapper.pp.PatchLogMapper">
    <!--获取补片数据-->
    <select id="SelectReplenish" >
        select
        r.id,
        r.review_status,
        r.reporting_work_id,
        r.patch_id,
        r.process_id,
        r.order_id,
        r.order_sort,
        o.project,
        o.batch,
        od.building_number,
        od.product_name,
        ogd.technology_number,
        ogd.glass_address,
        r.patch_num,
        od.width,
        od.height,
        od.shape,
        r.patch_type,
        r.patch_reason,
        r.responsible_team,
        r.responsible_personnel,
        r.responsible_equipment,
        r.patch_area,
        r.quality_inspector,
        r.patch_processes,
        r.reviewer,
        date(r.create_time) as create_time,
        date(r.update_time) as update_time
        from pp.patch_log r left join sd.order_detail od on r.order_id=od.order_id and r.order_sort=od.order_number
        left join sd.`order` o on r.order_id = o.order_id
        left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
        on r.order_id = ogd.order_id and r.order_sort = ogd.order_number
        <where>
            date(r.create_time)>=#{startDate} and date(r.create_time) &lt;= #{endDate}
        </where>
         order by r.review_status
        limit #{offset},#{pageSize};
    </select>
    <select id="SelectReplenishPageTotal" >
        select CEILING(count(zu.id)/#{pageSize}) as 'pageTotal',
        count(zu.id) as 'total'
        from (select r.id as id
        from pp.patch_log r left join sd.order_detail od on r.order_id=od.order_id and r.order_sort=od.order_number
        left join sd.`order` o on r.order_id = o.order_id
        left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
        on r.order_id = ogd.order_id and r.order_sort = ogd.order_number
        <where>
            date(r.create_time)>=#{startDate} and date(r.create_time) &lt;= #{endDate}
        </where>
              ) as zu
        limit #{offset},#{pageSize};
    </select>
    <select id="getMaximum" >
        select count(*) from pp.patch_log where  date(create_time)=CURDATE()
    </select>
    <insert id="insertReplenish"  useGeneratedKeys="true" >
        insert into pp.patch_log(patch_id,reporting_work_id,process_id,order_id, order_sort, technology_number, responsible_team,
                              responsible_personnel, patch_type, patch_reason, patch_processes, patch_num,
                                 patch_area,responsible_equipment,quality_inspector, reviewer, review_status, create_time)
        values (
                   #{oddNumber}, #{patchLog.reportingWorkId},#{patchLog.processId},#{patchLog.orderId},#{patchLog.orderSort},#{patchLog.technologyNumber},
                #{patchLog.responsibleTeam},#{patchLog.responsiblePersonnel},#{patchLog.patchType},#{patchLog.patchReason},
                #{patchLog.patchProcesses},#{patchLog.patchNum},#{patchLog.patchArea},#{patchLog.responsibleEquipment},#{patchLog.qualityInspector},"",0,now()
               )
    </insert>
    <update id="updateReplenish"  >
        update pp.patch_log set reviewer=#{userName},review_status=1,update_time=now() where id=#{patchLog.id}
    </update>
    <update id="updateDamageDetails"  >
        update pp.damage_details set quantity=quantity+#{patchLog.patchNum},patch_status=1 where id=#{patchLog.reviewer}
    </update>
    <select id="getSelectReplenish">
        select date(rw.reporting_work_time) as reportingWorkTime,
               o.order_id as orderId,
               dd.reporting_work_id as reportingWorkId,
               rw.production_id as productionId,
               rw.process_id as processId,
               o.project,
               o.batch,
               dd.id as reviewer,
               od.building_number as buildingNumber,
               dd.order_number as orderSort,
               od.product_name as productName,
               dd.technology_number as technologyNumber,
               ogd.glass_address as glassAddress,
               dd.breakage_quantity-dd.quantity as patchNum,
               od.width,
               od.height,
               od.shape,
               dd.breakage_quantity-dd.quantity as breakageQuantity,
               dd.return_process as patchProcesses,
               dd.breakage_reason as patchReason,
               dd.breakage_type as patchType,
               dd.responsible_personnel as responsiblePersonnel,
               dd.responsible_equipment as responsibleEquipment,
               dd.responsible_team as responsibleTeam,
               ROUND((dd.breakage_quantity-dd.quantity) * od.width * od.height / 1000000, 2) as patchArea,
               rw.qualityIns_pector as qualityInsPector
        from pp.damage_details dd
                 left join    pp.reporting_work_detail rwd on dd.reporting_work_id = rwd.reporting_work_id and dd.order_number=rwd.order_number  and dd.technology_number=rwd.technology_number
                 left join pp.reporting_work rw on dd.reporting_work_id = rw.reporting_work_id
                 left join sd.`order` o on rw.order_id = o.order_id
                 left join sd.order_detail od on rw.order_id = od.order_id and dd.order_number = od.order_number
                 left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
                           on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=0 and (dd.responsible_process=rw.this_process or (dd.responsible_process!=rw.this_process and dd.qualityIns_status=1))
    </select>
</mapper>
north-glass-erp/target/classes/mapper/pp/ReworkMapper.xml
@@ -98,7 +98,7 @@
                 left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
                           on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=1
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=1 and dd.qualityIns_status=1
    </select>