Browse Source
feat(npcIqc): 添加NPC来料检验模块功能
feat(npcIqc): 添加NPC来料检验模块功能
- 创建NpcIqc实体类,包含检验相关的字段定义 - 实现NpcIqcController控制器,提供分页查询接口 - 定义NpcIqcMapper数据访问层接口和XML映射文件 - 实现NpcIqcService业务逻辑层接口及具体实现类 - 集成供应商、物料和采购订单表的关联查询功能 - 添加多条件动态筛选和排序功能master
6 changed files with 227 additions and 0 deletions
-
29src/main/java/com/xujie/modules/npcIqc/controller/NpcIqcController.java
-
82src/main/java/com/xujie/modules/npcIqc/entity/NpcIqc.java
-
12src/main/java/com/xujie/modules/npcIqc/mapper/NpcIqcMapper.java
-
9src/main/java/com/xujie/modules/npcIqc/service/NpcIqcService.java
-
19src/main/java/com/xujie/modules/npcIqc/service/impl/NpcIqcServiceImpl.java
-
76src/main/resources/mapper/npcIqc/NpcIqcMapper.xml
@ -0,0 +1,29 @@ |
|||
package com.xujie.modules.npcIqc.controller; |
|||
|
|||
import com.xujie.common.utils.PageUtils; |
|||
import com.xujie.common.utils.R; |
|||
import com.xujie.modules.npcIqc.entity.NpcIqc; |
|||
import com.xujie.modules.npcIqc.service.NpcIqcService; |
|||
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; |
|||
|
|||
@RestController |
|||
@RequestMapping("npcIqc") |
|||
public class NpcIqcController { |
|||
|
|||
@Autowired |
|||
private NpcIqcService npcIqcService; |
|||
|
|||
/** |
|||
* 分页查询数据 |
|||
*/ |
|||
@PostMapping("/search") |
|||
public R search(@RequestBody NpcIqc npciqc){ |
|||
PageUtils page = npcIqcService.myPage(npciqc); |
|||
return R.ok().put("page", page); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,82 @@ |
|||
package com.xujie.modules.npcIqc.entity; |
|||
|
|||
import com.xujie.common.utils.QueryPage; |
|||
import lombok.Data; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
public class NpcIqc extends QueryPage { |
|||
|
|||
private String site; |
|||
|
|||
private String iqcNo; |
|||
|
|||
private String inspectionType; |
|||
|
|||
private String purOrder; |
|||
|
|||
private String supplierNo; |
|||
|
|||
private String supplierName; |
|||
|
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
|||
private Date dateReceived; |
|||
|
|||
private String itemCode; |
|||
|
|||
private String itemName; |
|||
|
|||
private Integer quantity; |
|||
|
|||
private Integer sampleSize; |
|||
|
|||
private BigDecimal dimA; |
|||
|
|||
private BigDecimal dimB; |
|||
|
|||
private BigDecimal dimC; |
|||
|
|||
private BigDecimal dimD; |
|||
|
|||
private BigDecimal dimE; |
|||
|
|||
private String inspectionTotal; |
|||
|
|||
private String inspectionStatus; |
|||
|
|||
private String problem; |
|||
|
|||
private String comments; |
|||
|
|||
private String inspectorName; |
|||
|
|||
private String createdBy; |
|||
|
|||
private String supplierEmail; |
|||
|
|||
private Boolean caRequest; |
|||
|
|||
private BigDecimal reworkHours; |
|||
|
|||
private BigDecimal reworkRate; |
|||
|
|||
private BigDecimal reworkTotal; |
|||
|
|||
private BigDecimal materialCost; |
|||
|
|||
private String collectionBatch; |
|||
|
|||
@DateTimeFormat(pattern = "yyyy-MM-dd") |
|||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
|||
private Date entryDate; |
|||
|
|||
private String issueNo; |
|||
|
|||
private String updateBy; |
|||
|
|||
private Date updateDate; |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
package com.xujie.modules.npcIqc.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.xujie.modules.npcIqc.entity.NpcIqc; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
@Mapper |
|||
public interface NpcIqcMapper extends BaseMapper<NpcIqc> { |
|||
Page<NpcIqc> myPage(Page<NpcIqc> page,@Param("npciqc") NpcIqc npciqc); |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
package com.xujie.modules.npcIqc.service; |
|||
|
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import com.xujie.common.utils.PageUtils; |
|||
import com.xujie.modules.npcIqc.entity.NpcIqc; |
|||
|
|||
public interface NpcIqcService extends IService<NpcIqc> { |
|||
PageUtils myPage(NpcIqc npciqc); |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package com.xujie.modules.npcIqc.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import com.xujie.common.utils.PageUtils; |
|||
import com.xujie.modules.npcIqc.entity.NpcIqc; |
|||
import com.xujie.modules.npcIqc.mapper.NpcIqcMapper; |
|||
import com.xujie.modules.npcIqc.service.NpcIqcService; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
@Service |
|||
public class NpcIqcServiceImpl extends ServiceImpl<NpcIqcMapper, NpcIqc> implements NpcIqcService { |
|||
@Override |
|||
public PageUtils myPage(NpcIqc npciqc) { |
|||
Page<NpcIqc> page = new Page<>(npciqc.getPage(), npciqc.getLimit()); |
|||
Page<NpcIqc> resultList = baseMapper.myPage(page, npciqc); |
|||
return new PageUtils(resultList); |
|||
} |
|||
} |
|||
@ -0,0 +1,76 @@ |
|||
<?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.xujie.modules.npcIqc.mapper.NpcIqcMapper"> |
|||
|
|||
<select id="myPage" resultType="com.xujie.modules.npcIqc.entity.NpcIqc"> |
|||
SELECT |
|||
n.site, |
|||
n.iqc_no, |
|||
n.inspection_type, |
|||
n.pur_order, |
|||
n.supplier_no, |
|||
s.supplier_name, |
|||
n.date_received, |
|||
n.item_code, |
|||
p.item_name, |
|||
n.quantity, |
|||
n.sample_size, |
|||
n.dim_a, |
|||
n.dim_b, |
|||
n.dim_c, |
|||
n.dim_d, |
|||
n.dim_e, |
|||
n.inspection_total, |
|||
n.inspection_status, |
|||
n.problem, |
|||
n.comments, |
|||
n.inspector_name, |
|||
n.created_by, |
|||
n.supplier_email, |
|||
n.ca_request, |
|||
n.rework_hours, |
|||
n.rework_rate, |
|||
n.rework_total, |
|||
n.material_cost, |
|||
n.collection_batch, |
|||
n.entry_date, |
|||
n.issue_no, |
|||
n.update_by, |
|||
n.update_date |
|||
FROM |
|||
npc_iqc n |
|||
LEFT JOIN |
|||
npc_supplier s ON n.supplier_no = s.supplier_no |
|||
LEFT JOIN |
|||
part p ON n.item_code = p.part_no |
|||
left join |
|||
POHeader poh ON n.pur_order = poh.po_no |
|||
<where> |
|||
<if test="npciqc.site != null and npciqc.site != ''"> |
|||
AND n.site = #{npciqc.site} |
|||
</if> |
|||
<if test="npciqc.iqcNo != null and npciqc.iqcNo != ''"> |
|||
AND n.iqc_no LIKE CONCAT('%', #{npciqc.iqcNo}, '%') |
|||
</if> |
|||
<if test="npciqc.supplierNo != null and npciqc.supplierNo != ''"> |
|||
AND n.supplier_no = #{npciqc.supplierNo} |
|||
</if> |
|||
<if test="npciqc.supplierName != null and npciqc.supplierName != ''"> |
|||
AND s.supplier_name LIKE CONCAT('%', #{npciqc.supplierName}, '%') |
|||
</if> |
|||
<if test="npciqc.itemCode != null and npciqc.itemCode != ''"> |
|||
AND n.item_code LIKE CONCAT('%', #{npciqc.itemCode}, '%') |
|||
</if> |
|||
<if test="npciqc.inspectionStatus != null and npciqc.inspectionStatus != ''"> |
|||
AND n.inspection_status = #{npciqc.inspectionStatus} |
|||
</if> |
|||
<if test="npciqc.entryDate != null and npciqc.entryDate != ''"> |
|||
AND CAST(n.entry_date AS DATE) = #{npciqc.entryDate} |
|||
</if> |
|||
<if test="npciqc.purOrder != null and npciqc.purOrder != ''"> |
|||
AND n.pur_order = #{npciqc.purOrder} |
|||
</if> |
|||
</where> |
|||
ORDER BY n.entry_date DESC, n.iqc_no DESC |
|||
</select> |
|||
</mapper> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue