1、插入->分组
2、鼠标选中分组头,
选择依据字段,可以多个
3、在内容行中插入子报表,插入明细网格
4、写分组打印报表conntroller
@RequestMapping("/bulkpick")
@ResponseBody
public String bulkpick() {
Map<String, Object> map = new HashMap<String, Object>();
map.put("Master", reportService.findOutbulkPickMaster(col));
map.put("Detail", reportService.findOutbulkPickDetail(col));
return toJson(map);
}
5、
主报表sql:
<select id="findOutbulkPickMaster" parameterType="com.wlyd.fmcgwms.util.CondOrderLimit" resultType="java.util.Map">
select distinct
up.WMUP_ID,
up.WMUP_BULKPICK_NO,
up.WMUP_BATCHPICK_NO,
up.CREATE_TIME,
up.CREATOR,
u.ES_LOGIN_NAME,
up.WMUP_BULKPICK_CDWACODE,
up.WMUP_BULKPICK_SKUNAME,
up.WMUP_BULKPICK_SKUUNIT,
up.WMUP_BULKPICK_SKUCODE,
up.WMUP_BULKPICK_WHOLENUM,
up.WMUP_BULKPICK_PICKNUM
from wm_out_bulkpick_${conditions.companyCode} up
left join es_user u on up.CREATOR = u.ES_ID
where 1=1
<if test="conditions.wmupBatchpickNo!=null and conditions.wmupBatchpickNo!=''">
and up.WMUP_BATCHPICK_NO = #{conditions.wmupBatchpickNo,jdbcType=VARCHAR}
</if>
</select>
子报表sql:
<select id="findOutbulkPickDetail" parameterType="com.wlyd.fmcgwms.util.CondOrderLimit" resultType="java.util.Map">
select distinct
up.WMUP_ID,
s.WMSA_OUTORDER_CODE,
o.WMOO_CUSTOMER_NAME,
s.WMSA_LT_CODE,
s.WMSA_BOX_NUMBER,
s.WMSA_TARY_NUMBER,
s.WMSA_SKU_BATCH,
s.WMSA_ASSINGED_NUMBER,
s.WMSA_BULKPICK_ID,
up.WMUP_BULKPICK_STATE,
CASE up.WMUP_BULKPICK_STATE
WHEN 0 THEN ''
WHEN 1 then s.WMSA_ASSINGED_NUMBER
end as wmsaPickedNumber
from wm_stock_assigned_${conditions.companyCode} s
left join wm_out_order_${conditions.companyCode} o on o.WMOO_CODE = s.WMSA_OUTORDER_CODE
left join wm_out_bulkpick_${conditions.companyCode} up on up.WMUP_ID= s.WMSA_BULKPICK_ID
where 1=1
<if test="conditions.wmupBatchpickNo!=null and conditions.wmupBatchpickNo!=''">
and up.WMUP_BATCHPICK_NO = #{conditions.wmupBatchpickNo,jdbcType=VARCHAR}
</if>
<if test="conditions.wmupId!=null and conditions.wmupId!=''">
and up.WMUP_ID = #{conditions.wmupId,jdbcType=INTEGER}
</if>
</select>