Browse Source

0000000334

zhoulisky 6 months ago
parent
commit
80a57d185f

+ 1 - 1
kd-service/kd-scientific/src/main/java/org/sky/scientific/excel/listener/XmGoodsImportListener.java

@@ -41,7 +41,7 @@ public class XmGoodsImportListener extends BaseReadListener {
 		excel.setXh(data.get(0));
 		excel.setUseDate(ValidationUtils.safeParseDate(data.get(1), DateUtil.PATTERN_DATE));
 		if (excel.getUseDate() == null) {
-			errors.add("申请日为空或格式错误,yyyy-MM-dd");
+			errors.add("领用日期为空或格式错误,yyyy-MM-dd");
 		}
 		excel.setXmbh(data.get(2));
 		excel.setXmmc(data.get(3));

+ 5 - 1
kd-service/kd-scientific/src/main/java/org/sky/scientific/mapper/XmMapper.xml

@@ -105,7 +105,11 @@
         LEFT JOIN kd_technician tech ON tech.id = COALESCE(get_xm_info(xm.id, 'XMFZR', #{ew.yearAndMonth}), xm.XMFZR) and tech.tenant_id = #{ew.tenantId}
         LEFT JOIN kd_department d on d.id = COALESCE(get_xm_info(xm.id, 'XMSQDWID', #{ew.yearAndMonth}), xm.XMSQDWID)
         WHERE xm.tenant_id = #{ew.tenantId}
-          and #{ew.yearAndMonth} between DATE_FORMAT(xm.XMKSSJ, '%Y%m') and  date_format(COALESCE(get_xm_info(xm.id, 'XMJSSJ', #{ew.yearAndMonth}),xm.XMJSSJ), '%Y%m')
+              and
+                (
+                    #{ew.yearAndMonth} between DATE_FORMAT(xm.XMKSSJ, '%Y%m') and  date_format(COALESCE(get_xm_info(xm.id, 'XMJSSJ', #{ew.yearAndMonth}),xm.XMJSSJ), '%Y%m')
+                    or (xm.XMKSSJ is null and xm.status=0 and DATE_FORMAT(xm.create_time, '%Y%m') <![CDATA[<=]]> #{ew.yearAndMonth})
+                )
         <if test="ew.xmbh!=null and ew.xmbh!=''">and xm.XMBH like concat('%',#{ew.xmbh},'%')</if>
         <if test="ew.xmmc!=null and ew.xmmc!=''">and COALESCE(get_xm_info(xm.id, 'XMMC', #{ew.yearAndMonth}), xm.XMMC) like concat('%',#{ew.xmmc},'%')</if>
         <if test="ew.xmfzrxm!=null and ew.xmfzrxm!=''">and tech.name like concat('%', #{ew.xmfzrxm},'%')</if>