guq 7 лет назад
Родитель
Сommit
89c5e990b2

+ 8 - 6
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/ProdInOutServiceImpl.java

@@ -222,13 +222,15 @@ public class ProdInOutServiceImpl extends CommonBaseServiceImpl<ProdInOutMapper,
             //检测调拨单拨入、拨出仓库是否一致
             List<ProdIODetailDTO> items = formData.getItems();
             int count = 0;
-            for (ProdIODetailDTO item : items) {
-                if (item.getPd_inwhcode().equals(item.getPd_whcode())) {
-                    count++;
+            if (BillCodeSeq.APPROPRIATIONINOUT.getName().equals(formData.getMain().getPi_class())) {
+                for (ProdIODetailDTO item : items) {
+                    if (item.getPd_inwhcode().equals(item.getPd_whcode())) {
+                        count++;
+                    }
+                }
+                if (count > 0) {
+                    throw new BizException(BizExceptionCode.STORAGE_WAREHOUSE_SAME);
                 }
-            }
-            if (count > 0) {
-                throw new BizException(BizExceptionCode.STORAGE_WAREHOUSE_SAME);
             }
             id = formData.getMain().getId();
             if (StringUtils.isEmpty(id)|| "0".equals(String.valueOf(id))) {

+ 1 - 1
applications/storage/storage-server/src/main/resources/mapper/ProdInOutMapper.xml

@@ -419,7 +419,7 @@
   </update>
 
   <select id="checkWarehouse" resultType="string" parameterType="com.usoftchina.saas.commons.dto.DocBaseDTO">
-    select GROUP_CONCAT( DISTINCT pi_inoutno) from prodinout left join prodiodetail on pi_id=pd_piid where pd_whcode=pd_inwhcode and pi_id in
+    select GROUP_CONCAT( DISTINCT pi_inoutno) from prodinout left join prodiodetail on pi_id=pd_piid where pd_whcode=pd_inwhcode and pi_class = '调拨单' and pi_id in
     <foreach collection="list" item="item" open="(" close=")" separator=",">
       #{item.id}
     </foreach>