Showing
9 changed files
with
145 additions
and
3 deletions
| ... | ... | @@ -31,16 +31,34 @@ public class SampleResultFeedback extends BaseEntity implements BaseDto { |
| 31 | 31 | private String customerId; |
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | - * 所属分厂 | |
| 34 | + * 客户名称 | |
| 35 | + */ | |
| 36 | + @TableField(exist = false) | |
| 37 | + private String customerName; | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 所属分厂ID | |
| 35 | 41 | */ |
| 36 | 42 | private String workshopId; |
| 37 | 43 | |
| 38 | 44 | /** |
| 45 | + * 所属分厂名称 | |
| 46 | + */ | |
| 47 | + @TableField(exist = false) | |
| 48 | + private String workshopName; | |
| 49 | + | |
| 50 | + /** | |
| 39 | 51 | * 订单ID |
| 40 | 52 | */ |
| 41 | 53 | private String orderId; |
| 42 | 54 | |
| 43 | 55 | /** |
| 56 | + * 订单编号 | |
| 57 | + */ | |
| 58 | + @TableField(exist = false) | |
| 59 | + private String orderNo; | |
| 60 | + | |
| 61 | + /** | |
| 44 | 62 | * 创建人ID |
| 45 | 63 | */ |
| 46 | 64 | @TableField(fill = FieldFill.INSERT) | ... | ... |
| 1 | +package com.lframework.xingyun.sc.impl.sample; | |
| 2 | + | |
| 3 | +import com.lframework.xingyun.sc.entity.SampleFeedbackTrackingDetail; | |
| 4 | +import com.lframework.starter.web.core.impl.BaseMpServiceImpl; | |
| 5 | +import com.lframework.starter.web.core.annotations.oplog.OpLog; | |
| 6 | +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; | |
| 7 | +import org.apache.commons.collections4.CollectionUtils; | |
| 8 | +import org.springframework.transaction.annotation.Transactional; | |
| 9 | +import com.lframework.xingyun.sc.mappers.SampleFeedbackTrackingDetailMapper; | |
| 10 | +import com.lframework.xingyun.sc.service.sample.SampleFeedbackTrackingDetailService; | |
| 11 | +import org.springframework.stereotype.Service; | |
| 12 | + | |
| 13 | +import java.util.Collections; | |
| 14 | +import java.util.List; | |
| 15 | + | |
| 16 | +@Service | |
| 17 | +public class SampleFeedbackTrackingDetailServiceImpl extends BaseMpServiceImpl<SampleFeedbackTrackingDetailMapper, SampleFeedbackTrackingDetail> implements SampleFeedbackTrackingDetailService { | |
| 18 | + | |
| 19 | + @Override | |
| 20 | + public SampleFeedbackTrackingDetail findById(String id) { | |
| 21 | + | |
| 22 | + return getBaseMapper().selectById(id); | |
| 23 | + } | |
| 24 | + | |
| 25 | + @OpLog(type = OtherOpLogType.class, name = "删除样品反馈和追踪明细,ID:{}", params = {"#id"}) | |
| 26 | + @Transactional(rollbackFor = Exception.class) | |
| 27 | + @Override | |
| 28 | + public void deleteById(String id) { | |
| 29 | + | |
| 30 | + getBaseMapper().deleteById(id); | |
| 31 | + } | |
| 32 | + | |
| 33 | + @Override | |
| 34 | + public List<SampleFeedbackTrackingDetail> listByFeedbackIds(List<String> feedbackIds) { | |
| 35 | + return Collections.emptyList(); | |
| 36 | + } | |
| 37 | + | |
| 38 | + @Override | |
| 39 | + public List<SampleFeedbackTrackingDetail> listByTrackingIds(List<String> trackingIds) { | |
| 40 | + return Collections.emptyList(); | |
| 41 | + } | |
| 42 | +} | ... | ... |
| 1 | 1 | package com.lframework.xingyun.sc.impl.sample; |
| 2 | 2 | |
| 3 | 3 | import com.github.pagehelper.PageInfo; |
| 4 | +import com.lframework.xingyun.sc.entity.SampleFeedbackTrackingDetail; | |
| 4 | 5 | import com.lframework.xingyun.sc.entity.SampleResultFeedback; |
| 5 | 6 | import com.lframework.starter.web.core.impl.BaseMpServiceImpl; |
| 6 | 7 | import com.lframework.starter.web.core.utils.PageResultUtil; |
| ... | ... | @@ -9,17 +10,27 @@ import com.lframework.starter.web.core.annotations.oplog.OpLog; |
| 9 | 10 | import com.lframework.starter.web.core.utils.PageHelperUtil; |
| 10 | 11 | import com.lframework.starter.common.utils.Assert; |
| 11 | 12 | import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; |
| 13 | +import com.lframework.xingyun.sc.service.sample.SampleFeedbackTrackingDetailService; | |
| 14 | +import org.apache.commons.collections4.CollectionUtils; | |
| 12 | 15 | import org.springframework.transaction.annotation.Transactional; |
| 13 | 16 | import com.lframework.xingyun.sc.mappers.SampleResultFeedbackMapper; |
| 14 | 17 | import com.lframework.xingyun.sc.service.sample.SampleResultFeedbackService; |
| 15 | 18 | import com.lframework.xingyun.sc.vo.sample.feedback.QuerySampleResultFeedbackVo; |
| 16 | 19 | import org.springframework.stereotype.Service; |
| 17 | 20 | |
| 21 | +import javax.annotation.Resource; | |
| 22 | +import java.util.Collections; | |
| 18 | 23 | import java.util.List; |
| 24 | +import java.util.stream.Collectors; | |
| 19 | 25 | |
| 20 | 26 | @Service |
| 21 | 27 | public class SampleResultFeedbackServiceImpl extends BaseMpServiceImpl<SampleResultFeedbackMapper, SampleResultFeedback> implements SampleResultFeedbackService { |
| 22 | 28 | |
| 29 | + | |
| 30 | + @Resource | |
| 31 | + private SampleFeedbackTrackingDetailService sampleFeedbackTrackingDetailService; | |
| 32 | + | |
| 33 | + | |
| 23 | 34 | @Override |
| 24 | 35 | public PageResult<SampleResultFeedback> query(Integer pageIndex, Integer pageSize, QuerySampleResultFeedbackVo vo) { |
| 25 | 36 | Assert.greaterThanZero(pageIndex); |
| ... | ... | @@ -33,6 +44,12 @@ public class SampleResultFeedbackServiceImpl extends BaseMpServiceImpl<SampleRes |
| 33 | 44 | |
| 34 | 45 | @Override |
| 35 | 46 | public List<SampleResultFeedback> query(QuerySampleResultFeedbackVo vo) { |
| 47 | + List<SampleResultFeedback> feedbackList = getBaseMapper().query(vo); | |
| 48 | + if (CollectionUtils.isEmpty(feedbackList)) { | |
| 49 | + return Collections.emptyList(); | |
| 50 | + } | |
| 51 | + List<String> feedbackIds = feedbackList.stream().map(SampleResultFeedback::getId).collect(Collectors.toList()); | |
| 52 | + List<SampleFeedbackTrackingDetail> detailList = sampleFeedbackTrackingDetailService.listByFeedbackIds(feedbackIds); | |
| 36 | 53 | |
| 37 | 54 | return getBaseMapper().query(vo); |
| 38 | 55 | } | ... | ... |
xingyun-sc/src/main/java/com/lframework/xingyun/sc/mappers/SampleFeedbackTrackingDetailMapper.java
0 → 100644
| 1 | +package com.lframework.xingyun.sc.mappers; | |
| 2 | + | |
| 3 | +import com.lframework.xingyun.sc.entity.SampleFeedbackTrackingDetail; | |
| 4 | +import com.lframework.starter.web.core.mapper.BaseMapper; | |
| 5 | + | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * <p> | |
| 9 | + * 样品反馈和追踪明细 Mapper 接口 | |
| 10 | + * </p> | |
| 11 | + * | |
| 12 | + */ | |
| 13 | +public interface SampleFeedbackTrackingDetailMapper extends BaseMapper<SampleFeedbackTrackingDetail> { | |
| 14 | + | |
| 15 | +} | ... | ... |
| 1 | +package com.lframework.xingyun.sc.service.sample; | |
| 2 | + | |
| 3 | +import com.lframework.xingyun.sc.entity.SampleFeedbackTrackingDetail; | |
| 4 | +import com.lframework.starter.web.core.service.BaseMpService; | |
| 5 | + | |
| 6 | +import java.util.List; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * 样品反馈和追踪明细 Service | |
| 10 | + */ | |
| 11 | +public interface SampleFeedbackTrackingDetailService extends BaseMpService<SampleFeedbackTrackingDetail> { | |
| 12 | + | |
| 13 | + /** | |
| 14 | + * 根据ID查询 | |
| 15 | + * | |
| 16 | + * @param id 主键ID | |
| 17 | + * @return SampleFeedbackTrackingDetail | |
| 18 | + */ | |
| 19 | + SampleFeedbackTrackingDetail findById(String id); | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * 根据ID删除 | |
| 23 | + * | |
| 24 | + * @param id 主键ID | |
| 25 | + */ | |
| 26 | + void deleteById(String id); | |
| 27 | + | |
| 28 | + /** | |
| 29 | + * 根据反馈单ID获取明细数据 | |
| 30 | + * | |
| 31 | + * @param feedbackIds 反馈单ID集合 | |
| 32 | + * @return List<SampleFeedbackTrackingDetail> | |
| 33 | + */ | |
| 34 | + List<SampleFeedbackTrackingDetail> listByFeedbackIds(List<String> feedbackIds); | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * 根据反馈单ID获取明细数据 | |
| 38 | + * | |
| 39 | + * @param trackingIds 追踪单ID集合 | |
| 40 | + * @return List<SampleFeedbackTrackingDetail> | |
| 41 | + */ | |
| 42 | + List<SampleFeedbackTrackingDetail> listByTrackingIds(List<String> trackingIds); | |
| 43 | +} | ... | ... |
| ... | ... | @@ -17,13 +17,19 @@ |
| 17 | 17 | SELECT |
| 18 | 18 | tb.id, |
| 19 | 19 | tb.customer_id, |
| 20 | + c.name as customer_name, | |
| 20 | 21 | tb.workshop_id, |
| 22 | + w.name as workshop_name, | |
| 21 | 23 | tb.order_id, |
| 24 | + o.order_no, | |
| 22 | 25 | tb.create_by_id, |
| 23 | 26 | tb.update_by_id, |
| 24 | 27 | tb.create_time, |
| 25 | 28 | tb.update_time |
| 26 | 29 | FROM sample_result_feedback AS tb |
| 30 | + LEFT JOIN base_data_customer c ON tb.customer_id = c.id | |
| 31 | + LEFT JOIN base_data_workshop w ON tb.workshop_id = w.id | |
| 32 | + LEFT JOIN purchase_order_info o ON tb.order_id = o.id | |
| 27 | 33 | </sql> |
| 28 | 34 | |
| 29 | 35 | <select id="query" resultMap="SampleResultFeedback"> | ... | ... |